[QUOTE]
Imports System.IO
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strT As String
Dim i As Integer
FileOpen(3, "D:\sn.ini", OpenMode.Input)
i = 0
While Not EOF(3)
strT = LineInput(3)
i = i + 1
End While
FileClose(3)
MessageBox.Show(strT)
End Sub
[/QUOTE]
上面的朋友,你那样也是好的.但看一下下面的与你的有什么区别呢,是不是下面的会更好一点呢?
Imports System.IO
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strT As String
Dim i As Integer
Dim File_Number As Integer
File_Number = FreeFile()
FileOpen(File_Number, "D:\sn.ini", OpenMode.Input)
i = 0
While Not EOF(File_Number)
strT = LineInput(File_Number)
i = i + 1
End While
FileClose(File_Number)
MessageBox.Show(strT)
End Sub