📄 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 cmdEditMm
Cancel = -1 'True
Caption = "修改密码"
Height = 360
Left = 2925
TabIndex = 6
Tag = "取消"
Top = 945
Width = 1140
End
Begin VB.TextBox txtZyID
Height = 300
Left = 840
TabIndex = 0
Top = 120
Width = 3255
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 txtMm
Height = 270
IMEMode = 3 'DISABLE
Left = 840
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 3255
End
Begin VB.Label lblLabels
Caption = "密码:"
Height = 255
Index = 1
Left = 105
TabIndex = 4
Tag = "密码(&P):"
Top = 540
Width = 690
End
Begin VB.Label lblLabels
AutoSize = -1 'True
Caption = "职员ID:"
Height = 180
Index = 0
Left = 105
TabIndex = 5
Tag = "用户名称(&U):"
Top = 150
Width = 630
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 cmdEditMm_Click()
Dim newForm As New frmXgmm
If newForm.checkMm(Trim(txtZyID), Trim(txtMm)) <> 1 Then
MsgBox "该职员身份或密码验证无效!", vbInformation
Set newForm = Nothing
Exit Sub
End If
newForm.lblZyID = Trim(txtZyID)
newForm.txtYmm = Trim(txtMm)
newForm.txtYmm.Enabled = False
newForm.txtXmm.Enabled = True
newForm.cmdOK.Enabled = True
newForm.Show vbModal
Set newForm = Nothing
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
Dim strZyID As String, strMm As String
Dim rs As ADODB.Recordset
strZyID = Trim(txtZyID)
strMm = Trim(txtMm)
Set rs = mCdt.rsGZRYDL(strZyID, strMm)
'验证用户
If rs.EOF Then
MsgBox "登录失败!", vbInformation
txtZyID.SetFocus
txtZyID.SelStart = 0
txtZyID.SelLength = Len(txtZyID.Text)
Else
gbytZyQX = rs("操作权限")
gstrZyID = strZyID
gblnOK = True
Hide
End If
rs.Close
Set rs = Nothing '释放对象
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -