📄 login.frm
字号:
VERSION 5.00
Begin VB.Form fLogin
Caption = "登陆"
ClientHeight = 2685
ClientLeft = 1065
ClientTop = 1350
ClientWidth = 3945
LinkMode = 1 'Source
LinkTopic = "From1"
ScaleHeight = 2685
ScaleWidth = 3945
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtUserName
Appearance = 0 'Flat
Height = 270
Left = 1320
TabIndex = 1
Top = 720
Width = 1725
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 0
Top = 1200
Width = 1725
End
Begin VB.Image Image1
Height = 375
Left = 840
MouseIcon = "login.frx":0000
MousePointer = 99 'Custom
Top = 1560
Width = 975
End
Begin VB.Image Image2
Height = 375
Left = 2280
MouseIcon = "login.frx":030A
MousePointer = 99 'Custom
Top = 1560
Width = 975
End
End
Attribute VB_Name = "fLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents rs As Recordset
Attribute rs.VB_VarHelpID = -1
Public OK As Boolean
' 确定当前时间
Dim nowdate As Date
'记录确定次数
Dim miCount As Integer
Dim response As Integer
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
TextBox.Font.Name = "宋体"
TextBox.Font.Size = 11
Next
OK = False
miCount = 0
txtUserName.BackColor = RGB(45, 83, 190)
txtUserName.ForeColor = RGB(20, 240, 60)
txtUserName.BorderStyle = 3
txtPassword.BackColor = RGB(56, 100, 204)
txtPassword.ForeColor = RGB(20, 240, 60)
txtPassword.BorderStyle = 4
txtUserName.SetFocus
End Sub
Private Sub Command1_Click()
Dim txtSQL As String
'ToDo: create test for correct password
'check for correct password
Username = ""
If Trim(txtUserName.Text = "") Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
txtSQL = "select * from 用户信息 where 用户名 = '" & txtUserName.Text & "'"
Set rs = db.Execute(txtSQL)
If rs.EOF = True Then
MsgBox "没有这个用户,请重新输入员工号!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If Trim(rs.Fields(1)) = Trim(txtPassword.Text) Then
OK = True
rs.Close
Me.Hide
Username = Trim(txtUserName.Text)
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
End If
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub Command _Click()
OK = False
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -