当前位置:编程学习 > C#/ASP.NET >>

vb.net random文件添加记录

Structure test 
Dim s_name As String 
Dim s_path As String 
Dim s_type As String 
End Structure 

Dim FileFolderPath As String 
Dim MyPath As String = CurDir() 
Dim t As test 


Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
Dim i As Integer 
i = 0 
FileOpen(1, MyPath & "\test.txt", OpenMode.Random) 
Do While Not EOF(1) 
i += 1 
FileGet(1, t, i) 
If t.s_name = 0 And t.s_path = 0 Then 
i = i - 1 
End If 
Loop 
record = i 
FileClose(1) 
End Sub 

我想读取test.txt当前的记录数,然后把记录数i赋给record,以便在之后继续添加新的记录。但是每次运行,都提示 FileGet(1, t, i) 这句有错,请问怎么回事呢?
--------------------编程问答-------------------- FileGet 1, t, i
或者
call FileGet(1, t, i)  --------------------编程问答--------------------
引用 1 楼 ZengHD 的回复:
FileGet 1, t, i
或者
call FileGet(1, t, i)

晕,我看成VB6了
补充:.NET技术 ,  VB.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,