Private Sub Command1_Click()
Dim utext As String, ptext As String, ufile As String, pfile As String
ufile = App.Path & "\用户名.txt" '改成ufile="d:\用户名.txt"也可以
pfile = App.Path & "\密码.txt"
Open ufile For Input As #1
utext = StrConv(InputB$(LOF(1), 1), vbUnicode)
Close #1
Open pfile For Input As #1
ptext = StrConv(InputB$(LOF(1), 1), vbUnicode)
Close #1
If InStr(utext, Text1) > 0 And InStr(ptext, Text2) > 0 Then
MsgBox "用户名和密码均存在!"
Else
MsgBox "用户名或密码不存在!"
Exit Sub
End If
End Sub
温馨提示:答案为网友推荐,仅供参考