在vb中 怎么读取txt中的内容,就是输入开头几个字符 显示出这一行后面的几个指定字符

如题所述

Private Sub Command1_Click()
Dim TextLine As String

Open "E:\1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, TextLine
If Left(TextLine, Len(Text1.Text)) = Text1.Text Then
MsgBox TextLine
Exit Do
End If
Loop
Close #1
End Sub
温馨提示:答案为网友推荐,仅供参考
相似回答