回复 2楼 renxiaoyao36
程序代码:
Private Sub Command1_Click() Dim S1 As String, I As Long, J As Long Dim S2 As String, S3 As String Open "c:\temp.txt" For Input As #1 S1 = StrConv(InputB(LOF(1), 1), vbUnicode) Close #1 I = InStr(S1, "59") On Error Resume Next J = InStr(I, S1, vbNewLine) S2 = Mid(S1, I + 3, J - I - 18) Text1.Text = S2 End Sub我使用了防止出错代码 On Error Resume Next 如果记事本了没有查找到相关信息就会出错,这个改怎么改一下呢?意思说没有查找到59就,略过。