谁帮我把这段VB代码说明下??

来源:百度知道 编辑:UC知道 时间:2024/06/06 18:53:55
Private Sub command1_click()
Dim r As String, s
Open "123.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, r
If InStr(r, Text1.Text) <> 0 Then Exit Do
Loop
s = Split(r, ",")
Form1.Label1.Caption = s(0)
Form1.Label2.Caption = s(1)
Form1.Label3.Caption = s(2)
Close #1
End Sub

Private Sub command1_click()
Dim r As String, s
Open "123.txt" For Input As #1'打开你的123.txt文件
Do While Not EOF(1)
Line Input #1, r
If InStr(r, Text1.Text) <> 0 Then Exit Do '一行一行地读,直到与text1.text匹配为止
Loop
s = Split(r, ",")'把这行的内容分成三段
Form1.Label1.Caption = s(0)'显示第一段
Form1.Label2.Caption = s(1)'显示第二段
Form1.Label3.Caption = s(2)'显示第三段
Close #1'关闭打开的文件
End Sub

Private Sub command1_click()
Dim r As String, s
Open "123.txt" For Input As #1'打开你的123.txt文件
Do While Not EOF(1)'一直读到结尾 结束循环结束
Line Input #1, r 'line input一行一行地读
If InStr(r, Text1.Text) <> 0 Then Exit Do '直到与text1.text匹配为止
Loop
s = Split(r, ",")'把这行的内容分成三行
Form1.Label1.Caption = s(0)'显示第一行
Form1.Label2.Caption = s(1)'显示第二行
Form1.Label3.Caption = s(2)'显示第三行
Close #1'关闭打开的文件
End Sub

你首先的知道