📄 frmuserlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmUserLogin
BorderStyle = 3 'Fixed Dialog
Caption = "管理员登录"
ClientHeight = 1635
ClientLeft = 45
ClientTop = 330
ClientWidth = 3825
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmUserLogin.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1635
ScaleWidth = 3825
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdCancel
Caption = "取消"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2152
TabIndex = 3
Top = 1170
Width = 960
End
Begin VB.CommandButton cmdOk
Caption = "登录"
Default = -1 'True
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 712
TabIndex = 2
Top = 1170
Width = 960
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Left = 1305
PasswordChar = "*"
TabIndex = 1
Top = 630
Width = 2040
End
Begin VB.ComboBox cboName
Appearance = 0 'Flat
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 1305
TabIndex = 0
Top = 225
Width = 2040
End
Begin VB.Label Label2
Caption = "密 码:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 465
TabIndex = 5
Top = 675
Width = 735
End
Begin VB.Label Label1
Caption = "管理员:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 465
TabIndex = 4
Top = 315
Width = 780
End
End
Attribute VB_Name = "frmUserLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'* 模 块 名 称 :管理员登陆
'* 功 能 描 述 :
'* 程序员姓名 :谭怀志
'* 最后修改人 :谭怀志
'* 最后修改时间:2003/6/26
'* 备 注:
'*******************************************************
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
Dim tmpPassword As String
On Error GoTo ADOError
'校验用户名和密码的正确性
strQry = "select Password from JFoperator where OperID='" & Trim(cboName.Text) & "'"
Set rstCustomers = GetRecordSet(cnnConnection, strQry)
If rstCustomers.RecordCount = 0 Then
MsgBox "对不起,这个管理还没有注册", vbCritical, ERRCAPTION
cboName.SetFocus
SendKeys "{HOME}+{END}"
Exit Sub
End If
'密码解密
tmpPassword = Decipher(CODEPASSWORD, rstCustomers!password)
On Error Resume Next
If txtPassword <> tmpPassword Then
MsgBox "输入的密码的不正确!", vbCritical, ERRCAPTION
Exit Sub
End If
blnLoginFlag = True
strOperatorID = Trim(cboName.Text)
Unload Me
'登陆成功,显示主菜单窗体
frmMain.Show
Exit Sub
ADOError:
DisplayADOError cnnConnection
End Sub
Private Sub CboName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then txtPassword.SetFocus
End Sub
Private Sub Form_Resize()
On Error GoTo ADOError
'将已有管理员载入组合框
strQry = "select OperID from JFoperator "
Set rstCustomers = GetRecordSet(cnnConnection, strQry)
While Not rstCustomers.EOF
cboName.AddItem rstCustomers!OperID
rstCustomers.MoveNext
Wend
If rstCustomers.RecordCount <> 0 Then
cboName.ListIndex = 0
End If
Exit Sub
ADOError:
DisplayADOError cnnConnection
End Sub
Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then cmdOK_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -