📄 frmlogin.frm
字号:
VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form frmLogin
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "登陆窗口 "
ClientHeight = 2760
ClientLeft = 45
ClientTop = 330
ClientWidth = 4845
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
MouseIcon = "frmLogin.frx":0442
ScaleHeight = 2760
ScaleWidth = 4845
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Interval = 20
Left = 120
Top = 1920
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 855
Left = 0
ScaleHeight = 855
ScaleWidth = 4815
TabIndex = 4
Top = 0
Width = 4815
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "企业人事管理系统"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 615
Left = 1800
TabIndex = 5
Top = 360
Width = 2535
End
Begin VB.Image Image1
Height = 840
Left = 120
Picture = "frmLogin.frx":0884
Stretch = -1 'True
Top = 0
Width = 1320
End
End
Begin VB.TextBox txtUser
Height = 300
Left = 1560
MaxLength = 50
TabIndex = 0
Top = 1080
Width = 2895
End
Begin VB.TextBox txtPWD
Height = 300
IMEMode = 3 'DISABLE
Left = 1560
MaxLength = 50
PasswordChar = "*"
TabIndex = 1
Top = 1560
Width = 2895
End
Begin MSForms.CommandButton cmdCancel
Height = 375
Left = 3240
TabIndex = 7
Top = 2280
Width = 1095
Caption = "取消"
PicturePosition = 327683
Size = "1931;661"
Picture = "frmLogin.frx":55C1
FontName = "宋体"
FontHeight = 180
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
End
Begin MSForms.CommandButton cmdOK
Height = 375
Left = 1680
TabIndex = 6
Top = 2280
Width = 1095
Caption = "确定"
PicturePosition = 327683
Size = "1931;661"
Picture = "frmLogin.frx":76FB
FontName = "宋体"
FontHeight = 180
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
End
Begin VB.Line Line1
BorderColor = &H80000005&
Index = 0
X1 = 225
X2 = 4500
Y1 = 2190
Y2 = 2190
End
Begin VB.Line Line3
BorderColor = &H8000000C&
Index = 0
X1 = 240
X2 = 4500
Y1 = 2160
Y2 = 2160
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 255
Left = 600
TabIndex = 3
Top = 1200
Width = 735
End
Begin VB.Label Label2
Caption = "密 码:"
Height = 255
Left = 600
TabIndex = 2
Top = 1560
Width = 735
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim iTm As Integer
Public bOk As Boolean
Dim i As Integer
Private Sub asCancel_Click(Cancel As Boolean)
End
End Sub
Private Sub cmdOk_Click()
On Error GoTo error_conn
Dim strUser As String
Dim strPwd As String
Dim strSql As String
Dim strMsg As String
Dim rs As ADODB.Recordset
strUser = txtUser
strPwd = txtPWD
strSql = "select * from t_user where 用户='" & strUser & "' and 密码='" & strPwd & "'"
Set rs = ExecuteSQL(strSql, strMsg)
If rs.EOF Then
MsgBox "用户名或密码错误,请重新输入", vbOKOnly + vbExclamation, "抱歉"
iTm = iTm + 1
TextFocus txtPWD
If iTm > 3 Then
End
End If
Else
m_UN = rs.Fields(0).Value
m_UP = rs.Fields(1).Value
m_UZ = rs.Fields(2).Value
rs.Close
'添加操作员登陆时间
strSql = "insert into t_login (用户,登录时间) values('" & strUser & "','" & Now & "')"
Set rs = ExecuteSQL(strSql, strMsg)
Unload Me
bOk = True
End If
Exit Sub
'出错
error_conn:
MsgBox "错误号:" & Err.number, vbOKOnly, "出错"
End Sub
Private Sub Form_Load()
bOk = False
iTm = 1
Call DarkMe(Me, 0)
i = 0
End Sub
Private Sub Label4_Click()
End Sub
Private Sub Timer1_Timer()
If i < 250 Then
i = i + 25
Else
i = 255
End If
Call DarkMe(Me, i)
Me.refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -