📄 login_frm.frm
字号:
VERSION 5.00
Begin VB.Form login
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 4500
ClientLeft = 0
ClientTop = 0
ClientWidth = 6000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "login_frm.frx":0000
ScaleHeight = 4500
ScaleWidth = 6000
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtServer
BackColor = &H00FFFF00&
BorderStyle = 0 'None
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 435
Left = 2880
TabIndex = 0
Text = "lab2"
Top = 2450
Width = 2025
End
Begin VB.TextBox txtPassword
BackColor = &H00FFFF00&
BorderStyle = 0 'None
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 435
IMEMode = 3 'DISABLE
Left = 2880
PasswordChar = "*"
TabIndex = 2
Top = 3700
Width = 2025
End
Begin VB.TextBox txtOperID
BackColor = &H00FFFF00&
BorderStyle = 0 'None
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 435
Left = 2900
TabIndex = 1
Text = "admin"
Top = 3090
Width = 2025
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Height = 255
Left = 0
TabIndex = 5
Top = 0
Width = 5535
End
Begin VB.Label lblClose
BackStyle = 0 'Transparent
Height = 225
Left = 5760
MouseIcon = "login_frm.frx":4732
MousePointer = 99 'Custom
TabIndex = 4
ToolTipText = "关闭"
Top = 0
Width = 225
End
Begin VB.Label lblOK
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "OK"
BeginProperty Font
Name = "Century Gothic"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF00&
Height = 480
Left = 5055
MouseIcon = "login_frm.frx":4B74
MousePointer = 99 'Custom
TabIndex = 3
Top = 3750
Width = 510
End
End
Attribute VB_Name = "login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public rsUser As ADODB.Recordset
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then Unload Me '按ESC键退出
End Sub
Private Sub lblClose_Click()
Unload Me
End Sub
Private Sub lblOK_Click()
On Error GoTo err1:
'初始化并打开公共连接
Set cnn = New clsCon
cnn.connect txtServer.Text
'初始化并打开操作员记录集
Set rsUser = New ADODB.Recordset
rsUser.Open "select * from operator", cnn.c, adOpenKeyset, adLockOptimistic
'操作员身份验证
While Not rsUser.EOF
If rsUser.Fields("OperID") = txtOperID.Text And rsUser.Fields("PassWord") = passEncrypt_Decrypt(txtPassword.Text) Then
right = rsUser.Fields("rights") ' 记录操作员权限
operatorid = rsUser.Fields("OperID") '记录操作员ID
main.Show
Unload login
Exit Sub
End If
rsUser.MoveNext
Wend
MsgBox "用户名和密码不匹配,请检查!", vbExclamation
txtOperID.SetFocus
err1:
End Sub
Private Sub lblOK_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblOK.ForeColor = &H80000001
End Sub
Private Sub lblOK_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblOK.ForeColor = &HFFFF00
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -