Private Sub command1_click()Dim r As String, sOpen "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匹配为止Loops = Split(r, ",")'把这行的内容分成三行Form1.Label1.Caption = s(0)'显示第一行Form1.Label2.Caption = s(1)'显示第二行Form1.Label3.Caption = s(2)'显示第三行Close #1'关闭打开的文件End Sub