📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "操作员登陆"
ClientHeight = 1890
ClientLeft = 45
ClientTop = 330
ClientWidth = 5400
ControlBox = 0 'False
Icon = "frmLogin.frx":0000
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1890
ScaleWidth = 5400
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "退出(&E)"
Height = 375
Left = 4080
TabIndex = 5
Top = 1440
Width = 1215
End
Begin VB.CommandButton cmdOK
Caption = "确定(&O)"
Default = -1 'True
Height = 375
Left = 2640
TabIndex = 4
Top = 1440
Width = 1215
End
Begin VB.TextBox txtPWD
Height = 315
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 20
PasswordChar = "*"
TabIndex = 3
Top = 840
Width = 2415
End
Begin VB.TextBox txtName
Height = 315
Left = 1440
MaxLength = 20
TabIndex = 2
Top = 240
Width = 2415
End
Begin VB.Label lvlPWD
AutoSize = -1 'True
Caption = "操作员口令"
Height = 180
Left = 360
TabIndex = 1
Top = 960
Width = 900
End
Begin VB.Label lbName
AutoSize = -1 'True
Caption = "操作员名称"
Height = 180
Left = 360
TabIndex = 0
Top = 360
Width = 900
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdExit_Click()
End
End Sub
Private Sub Cmdok_Click()
Dim strSQL As String '查询的SQL语句
strSQL = "select * from UserValidate where (UserName='" & Trim(TxtName.Text) & _
"')and (UserPWD='" & Trim(txtPWD.Text) & "')"
If QueryEmpInfo(strSQL) = True Then
If g_DBRct.BOF = False And g_DBRct.EOF = False Then
'如果登陆成功,关闭本窗口,显示员工信息窗口
Unload Me
frmMain.Show
Else
'登陆不成功,关闭窗口,结束程序
x = MsgBox("输入的操作员名称或者口令非法,请注意输入的大小写敏感,重新输入吗?", vbYesNo, "非法的操作员口令")
If x = 6 Then
TxtName.SetFocus
End If
If x = 7 Then
Unload Me
End If
End If
End If
End Sub
Private Sub Form_Load()
TxtName.Text = "Administrator"
Cmdok.Enabled = False
End Sub
Private Sub txtPWD_Change()
Cmdok.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -