老衲倒是有一个
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button2
Exit
Case $Button1
$user = GUICtrlRead($in1)
$pass = GUICtrlRead($in2)
If $user = "" Then
MsgBox(64, "提示", "请输入用户名,用户名不能为空。", 5)
Else
If $pass = "" Then
MsgBox(64, "提示", "请输入密码,", 5)
Else
$conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datadir & ";Jet Oledb:Database Password=123")
$RS.ActiveConnection = $conn
MsgBox(0, "0", "Select * From users where admin=" & "'" & MD5_String($user) & "'" & 'and password=' & "'" & MD5_String($pass) & "'")
$RS.Open("Select * From users where admin=" & "'" & MD5_String($user) & "'" & 'and password=' & "'" & MD5_String($pass) & "'")
If $RS.eof Then
MsgBox(16, "警告", "用户名或密码错误,请重新输入。")
$conn.close
Else
GUIDelete($Form1)
ExitLoop
EndIf
EndIf
EndIf
EndSwitch
WEnd
其他部分自己加 不然太长 懒得传附件 |