vb如何查找文件中是否有某些字符

2024-12-12 07:35:08
推荐回答(2个)
回答1:

Dim s As String, t As String
Open "文件名路径" For Binary As #1
s = Input(LOF(1), #1)
Close #1
t = "要查找的字符"
If Instr(s, t) Then
MsgBox "文件中存在要查找的字符!"
Else
MsgBox "文件中不存在要查找的字符!"
End If

回答2:

循环查找比对!