📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
Caption = "企业人事系统登录"
ClientHeight = 3765
ClientLeft = 60
ClientTop = 345
ClientWidth = 5850
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 3765
ScaleMode = 0 'User
ScaleWidth = 5949.152
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000000&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 1920
TabIndex = 6
Text = "密码:"
Top = 3120
Width = 615
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000000&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 240
TabIndex = 5
Text = "用户:"
Top = 3120
Width = 615
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 4800
TabIndex = 3
Top = 3120
Width = 885
End
Begin VB.CommandButton cmdOK
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 3840
TabIndex = 2
Top = 3120
Width = 885
End
Begin VB.TextBox PassWord
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 1
Top = 3120
Width = 856
End
Begin VB.TextBox UserName
Appearance = 0 'Flat
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 960
TabIndex = 0
Text = "Admin"
Top = 3120
Width = 855
End
Begin VB.Frame Frame1
Height = 855
Left = 120
TabIndex = 4
Top = 2760
Width = 5655
End
Begin VB.Image Image1
Height = 2775
Left = 0
Picture = "frmLogin.frx":0000
Stretch = -1 'True
Top = 0
Width = 5895
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim pwdCount As Integer
Private Sub cmdCancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub cmdOK_Click()
Dim SQL As String
Dim rs As ADODB.Recordset
If Trim(UserName.Text = "") Then
MsgBox "没有输入用户名称,请重新输入!", vbOKOnly + vbExclamation, "警告"
UserName.SetFocus
Else '查询用户
SQL = "select * from UserInfo where UserID='" & UserName.Text & "'"
Set rs = TransactSQL(SQL)
If iflag = 1 Then
If rs.EOF = True Then
MsgBox "没有这个用户,请重新输入!", vbOKOnly + vbExclamation, "警告"
UserName.SetFocus
Else
If Trim(rs.Fields(1)) = Trim(PassWord.Text) Then
rs.Close
Me.Hide
gUserName = Trim(UserName.Text) '保存用户名称
FrmMain.Show
Unload Me
Else
MsgBox "密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
PassWord.SetFocus
PassWord.Text = ""
End If
End If
Else
Unload Me
End If
End If
pwdCount = pwdCount + 1 '判断输入次数
If pwdCount = 3 Then
Unload Me
Exit Sub
End If
End Sub
Private Sub Form_Load()
pwdCount = 0
gUserName = ""
End Sub
Private Sub PassWord_KeyDown(KeyCode As Integer, Shift As Integer)
TabToEnter KeyCode
End Sub
Private Sub UserName_KeyDown(KeyCode As Integer, Shift As Integer)
TabToEnter KeyCode
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -