📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登录“图书借阅系统”"
ClientHeight = 1485
ClientLeft = 45
ClientTop = 330
ClientWidth = 4230
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1485
ScaleWidth = 4230
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
WhatsThisButton = -1 'True
WhatsThisHelp = -1 'True
Begin VB.CommandButton cmdEditPass
Cancel = -1 'True
Caption = "修改密码"
Height = 360
Left = 2925
TabIndex = 4
Tag = "取消"
Top = 945
Width = 1140
End
Begin VB.TextBox txtAdminID
Height = 300
Left = 960
MaxLength = 10
TabIndex = 0
Top = 120
Width = 3135
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 360
Left = 1680
TabIndex = 3
Tag = "取消"
Top = 960
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 360
Left = 420
TabIndex = 2
Tag = "确定"
Top = 960
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 270
IMEMode = 3 'DISABLE
Left = 960
MaxLength = 10
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 3135
End
Begin VB.Label lblLabels
AutoSize = -1 'True
Caption = "登录密码:"
Height = 180
Index = 1
Left = 105
TabIndex = 5
Tag = "密码(&P):"
Top = 540
Width = 810
End
Begin VB.Label lblLabels
AutoSize = -1 'True
Caption = "管理员ID:"
Height = 180
Index = 0
Left = 105
TabIndex = 6
Tag = "用户名称(&U):"
Top = 150
Width = 810
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 gblnOK As Boolean
Private Sub cmdCancel_Click()
gblnOK = False
Hide
End Sub
Private Sub cmdEditPass_Click()
Dim newForm As New frmEditPassword
If newForm.checkPassword(Trim(txtAdminID), Trim(txtPassword)) <> 1 Then
MsgBox "该管理员身份或密码验证无效!", vbInformation
Set newForm = Nothing
Exit Sub
End If
newForm.lblAccreditID = Trim(txtAdminID)
newForm.txtOldPassword = Trim(txtPassword)
newForm.txtOldPassword.Enabled = False
newForm.txtNewPassword.Enabled = True
newForm.cmdOK.Enabled = True
newForm.Show vbModal
Set newForm = Nothing
End Sub
Private Sub cmdOK_Click()
Dim strAdminID As String, strPassword As String
Dim rs As ADODB.Recordset
strAdminID = Trim(txtAdminID)
strPassword = Trim(txtPassword)
Set rs = mCdt.rsSystemEnter(strAdminID, strPassword)
'验证用户
If rs.EOF Then
MsgBox "登录失败!", vbInformation
txtAdminID.SetFocus
txtAdminID.SelStart = 0
txtAdminID.SelLength = Len(txtAdminID.Text)
Else
gbytAccredit = rs("权限")
gstrAdminID = strAdminID
gblnOK = True
Hide
End If
rs.Close
Set rs = Nothing '释放对象
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -