📄 客户端登录窗口.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登录"
ClientHeight = 1545
ClientLeft = 5835
ClientTop = 5010
ClientWidth = 3750
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 912.837
ScaleMode = 0 'User
ScaleWidth = 3521.047
ShowInTaskbar = 0 'False
Begin VB.TextBox txtUserName
Height = 345
Left = 1290
TabIndex = 1
Top = 135
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 390
Left = 1440
TabIndex = 4
Top = 1020
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 1290
PasswordChar = "*"
TabIndex = 3
Top = 525
Width = 2325
End
Begin VB.Label lblLabels
Caption = "用户名称(&U):"
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 150
Width = 1080
End
Begin VB.Label lblLabels
Caption = "密码(&P):"
Height = 270
Index = 1
Left = 105
TabIndex = 2
Top = 540
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public LoginSucceeded As Boolean
Const HKEY_CURRENT_USER = &H80000001
Private Sub cmdOK_Click()
rec_base.Open "select * from base where no = '" & txtUserName & "'"
If rec_base.RecordCount = 0 Then
MsgBox "用户名不存在。请重新输入", vbCritical
txtUserName.SetFocus
SendKeys "{Home}+{End}"
rec_base.Close
Exit Sub
End If
rec_info.Open "select * from info where no= '" & txtUserName & "' and password = '" & txtPassword & "'"
If rec_info.RecordCount <= 0 Then
MsgBox "密码不正确,请重新输入.", vbCritical
txtPassword.SetFocus
SendKeys "{Home}+{End}"
rec_base.Close
rec_info.Close
Exit Sub
End If
MsgBox " 登陆成功!"
'Shell "explorer.exe"
'SaveStringWORD HKEY_CURRENT_USER, "software\microsoft\windows\currentversion\policies\system", "DisableTaskMgr", 0
rec_count.Open "select * from count where no= '" & txtUserName & "'"
rec_class.Open "select * from class where class_no= '" & Left(txtUserName, 7) & "'"
rec_used.Open "select * from used_rec "
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
App.TaskVisible = False
'Shell App.Path & "\系统监控\监控工程.exe", vbMinimizedNoFocus
'打开数据库
On Error Resume Next
Set db = New Connection
db.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=student;Data Source=127.0.0.1"
'db.Open "Provider=SQLOLEDB.1;Password=1201;Persist Security Info=True;User ID=sa;Initial Catalog=student;Data Source=127.0.0.1"
If db.State = 0 Then MsgBox "服务器还没开": End
Set rec_base = New Recordset
Set rec_count = New Recordset
Set rec_info = New Recordset
Set rec_class = New Recordset
Set rec_sys_info = New Recordset
Set rec_used = New Recordset
With rec_base
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
End With
With rec_info
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
End With
With rec_count
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
End With
With rec_class
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
End With
With rec_sys_info
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
.Open "select * from sysinfo "
.MoveFirst
End With
With rec_used
.ActiveConnection = db
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = 3
End With
'Id = Val(GetJingCheng("explorer.exe"))
'If Id <> 0 Then EndJingCheng (Id)
'SaveStringWORD HKEY_CURRENT_USER, "software\microsoft\windows\currentversion\policies\system", "DisableTaskMgr", 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -