请教一个简单的语法
我想有用下面的方法破解一个密码,但第二个for 有语法问题,那个高人能不能帮忙修改下??
Dim i As Integer
Dim k As String
Dim pass_str As String251
For i = 1 To 12
passworderror:
for (k=0 to 9) or (k=A to Z) or (k=a to z) '在此处有语法问题,请大家帮下忙
pass_str = pass_str + k
nkey = pass_str
' nkey = "59585a4d4447 "
'nkey = "FFFFFFFFFFFF "
st = rf_authentication(xdev, maxmode, shanq)
If st% <> 0 Then
GoTo passworderror
'R_W_Mifare = "err: " & LoadResString(109)
'Exit Function
' '密码验证失败
End If
Next
Next
[解决办法]
Dim i, k As Integer
Dim k As String
Dim pass_str As String ' * 251
k = 49
For i = 1 To 12
passworderror:
If k = 57 Then k = 64
If k = 90 Then k = 96
If k = 122 Then GoTo NextFor
k = k + 1
pass_str = pass_str & Chr(k)
nkey = pass_str
st = rf_authentication(xdev, maxmode, shanq)
If st% <> 0 Then GoTo passworderror
NextFor:
Next i
[解决办法]
Dim i, k As Integer
Dim k As String
Dim pass_str As String ' * 251
nkey=vbNullString '设置一个初值
For i = 1 To 12
k = 49
passworderror:
If k = 57 Then k = 64
If k = 90 Then k = 96
If k = 122 Then GoTo NextFor
k = k + 1
pass_str=nkey '此处增加一句
pass_str = pass_str & Chr(k)
nkey = pass_str
st = rf_authentication(xdev, maxmode, shanq)
If st% <> 0 Then GoTo passworderror
NextFor:
Next i
[解决办法]
For i = 1 To 12
k = 47 ' ' ' 'k = 49 错
passworderror: