VB读取目录下的TXT
Private Sub Timer1_Timer()On Error Resume Next
Text4.Text = Clipboard.GetText '将剪贴板中文本赋给text1
For i = 1 To Len(Text4.Text)
s = Mid(Text4.Text, i, 1)
If IsNumeric(s) Then t = t & s
Next i
Label1 = t
End Sub
Private Sub Timer2_Timer()
Dim arr, i, mark
mark = Label1.Caption
Open App.Path & "\1.txt" For Input As #1
arr = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vbNewLine)
Close #1
For i = 0 To UBound(arr)
If InStr(arr(i), mark) = 1 Then Label2.Caption = Split(arr(i), "=")(1)
Next
End Sub
如果没有找到怎么返回呢?
[此贴子已经被作者于2019-1-1 03:09编辑过]