2010-02-13 58 views
1

我們的組織正在使用UniObjects for .NET,但該CD似乎已丟失。我需要弄清楚如何讀寫Universe中的文件。請注意,程序是用VB.NETUniObjects 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

首先,你可以找到Rocket's website

這裏有一些讀/寫

' 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) 

我敢肯定你的想法現在:)

您的用戶手冊