2010-02-13 2 views
1

우리 조직에서 UniObjects for .NET을 사용하고 있지만 CD가 누락 된 것 같습니다. 유니버스에서 파일을 읽고 쓰는 방법을 알아야합니다. 이 프로그램은 VB.NET으로 작성되었습니다.UniObjects for .NET - UniVerse 파일 읽기 및 쓰기

Dim uniSession As UniSession 
Private DATABASE_IDENTIFIER As String = "uvcs" 

uniSession = UniObjects.OpenSession(_hostname, _username, _password, _account, DATABASE_IDENTIFIER) 

' Clear the already existing LICENCE_STATUS table 
Dim nepiLicenceStatusFile As UniFile = uniSession.CreateUniFile("LICENCE_STATUS") 
nepiLicenceStatusFile.Open() 
nepiLicenceStatusFile.ClearFile() 

' Insert new values in the LICENCE_STATUS table??? 
' Read values from the LICENCE_STATUS table??? 

새 값을 삽입하고 LICENCE_STATUS 테이블에서 값을 읽는 방법을 알아야합니다. 아무도 나를 도울 수 있습니까?

답변

2

첫째, 당신은 내가 지금 생각을 :)

확신

' read a record "2" 
Dim ar_record As UniDynArray = nepiLicenceStatusFile.Read("2") 

' write back as record "2new" 
nepiLicenceStatusFile.Read("2new", ar_record) 

' write a random string to a record 
nepiLicenceStatusFile.write("2new", "My random string") 

'read a field "7" from record "2" 
Dim ar_record2 As UniDynArray = nepiLicenceStatusFile.ReadField("2", 7) 

' write back to field "8" 
nepiLicenceStatusFile.write("2", 8) 

'read number of fields (4,5,6) from record "2" 
Dim lFieldSet() As Integer = {4, 5, 6} 
Dim ar_record3 As UniDynArray = nepiLicenceStatusFile.ReadFields("2", lFieldSet) 

' read named field "LNAME" from record "2" 
Dim ar_record4 As UniDynArray = nepiLicenceStatusFile.ReadNamedField("2", "LNAME") 

' read records (2, 12, 3 and 4) as unidataset 
Dim sArray As String() = {"2", "12", "3", "4"} 

uSet = nepiLicenceStatusFile.ReadRecords(sArray) 

를 작성 Rocket's website

여기 읽기의 몇 가지 예입니다/당신의 정보를 얻을 수 있습니다