Private Sub cmdok_Click()
If txtUserName.Text = "" Or txtPassword.Text = "" Then
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
Label5.Caption = "登录失败!帐号或密码不能为空!"
End If
Dim fff As String
Dim gs As String
Dim dlcg As String
Set rs = CnNew.Execute("Select * From [jz] Where 帐号='" & Replace(txtUserName.Text, "'", "''") & "' And 密码='" & txtPassword.Text & "'")
If Not rs.EOF Then '如果符合
fff = rs("剩余时间")
gs = rs("挂失")
If gs = 0 Then '没有挂失
Randomize Timer
 Rnd (gs)
If fff > 0 Then '剩余时间不为零
'是否登录
Set rs2 = CnNew.Execute("Select * From [sw] Where 帐号='" & Replace(txtUserName.Text, "'", "''") & "' And 登录状态='正常'")
If Not rs2.EOF Then '如果符合
'dlcg = rs2("登录状态")
'此帐号已登录
txtUserName.Text = ""
txtPassword.Text = ""
'Label6.Caption = ""
'Label7.Caption = ""
txtUserName.SetFocus
Label5.Caption = "登录失败!此帐号已登录!"
Else'If dlcg = "" Then
'取消禁用任务管理器
Close
'取消禁用任务栏
Dim hTaskBar As Long
     
     hTaskBar = FindWindow("Shell_TrayWnd", 0&)
     ShowWindow hTaskBar, SW_SHOWNORMAL
'取消禁用windows菜单
If bswap Then
     SetParent win, task
     ShowWindow win, 1
End If
rs.Close: Set rs = Nothing
rs2.Close: Set rs2 = Nothing
CnNew.Close: Set CnNew = Nothing
Open "C:\Program Files\swkz\zh.txt" For Output As #1
Print #1, txtUserName.Text
Close
Open "C:\Program Files\swkz\sj.txt" For Output As #1
Print #1, fff
Close
Label6.Caption = "剩余时间:"
Label7.Caption = fff & "分钟"
Randomize Timer
 Rnd (fff)
Shell "C:\Program Files\swkz\rwgl.exe", vbNormalFocus
Shell "C:\Program Files\swkz\dl.exe", vbNormalFocus
Call datalink.cloRs
Call datalink.Clocn
Shell "taskkill /f /im 通用进程隐藏工具.exe"  '结束进程Unload Me '关闭现有窗体
End If
'MsgBox "登录成功"
Else '如果不符合
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
Label5.Caption = "登录失败!剩余时间为零!"
End If
Else '如果不符合
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
Label5.Caption = "登录失败!帐号已经挂失!"
End If
Else
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
Label5.Caption = "登录失败!用户名或密码错误!"
'MsgBox "对不起,您的用户名密码不正确", vbCritical, "错误!"
End If
End Sub