第1个回答 2011-01-11
Private Sub Form_Load()
On Error Resume Next
Open App.Path & "\ok.txt" For Input As #1
Do Until EOF(1)
Line Input #1, x
For Each i In Split(x, vbCrLf)
If LCase(Right(i, 2)) = LCase("no") Then Text2.Text = Text2.Text & Trim(Split(i, " ")(1)) & vbCrLf: Text1.Text = Text1.Text & Trim(Split(x, " ")(1)) & vbCrLf
Next
Loop
Close #1
End Sub
'2个textbox,multiline=1,scrollbars=2.代码可以自己改,这里是读取当前文件夹下的ok.txt本回答被提问者采纳
第2个回答 2011-01-11
'假设你的 Ok.txt 在 E 盘下
Private Sub Command1_Click()
Open "E:\ok.txt" For Input As #1
Text2 = StrConv(InputB(LOF(1), #1), vbUnicode)
Close #1
Text1 = Mid(Text2, InStr(Text2, "NO") - 34, 10)
Text2 = Mid(Text2, InStr(Text2, "NO") - 18, 12)
End Sub