📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form FrmLogin
Caption = "登录"
ClientHeight = 3135
ClientLeft = 60
ClientTop = 345
ClientWidth = 4365
Icon = "FrmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3135
ScaleWidth = 4365
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Interval = 500
Left = 120
Top = 1200
End
Begin VB.TextBox TxtLoginName
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1320
TabIndex = 4
Top = 1800
Width = 1455
End
Begin VB.TextBox TxtPassword
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 2400
Width = 1455
End
Begin VB.PictureBox Picture1
Height = 975
Left = 0
Picture = "FrmLogin.frx":0442
ScaleHeight = 915
ScaleWidth = 4515
TabIndex = 2
Top = 120
Width = 4575
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "上海胜隆汽配进销存管理系统"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 7
Top = 240
Width = 4215
End
End
Begin VB.CommandButton CmdLogin
Caption = "登 录"
BeginProperty Font
Name = "楷体_GB2312"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 1
Top = 1800
Width = 855
End
Begin VB.CommandButton CmdCancel
Caption = "取 消"
BeginProperty Font
Name = "楷体_GB2312"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 0
Top = 2400
Width = 855
End
Begin VB.Line Line1
BorderColor = &H00FF0000&
X1 = 120
X2 = 4920
Y1 = 2880
Y2 = 2880
End
Begin VB.Line Line2
BorderColor = &H00FF0000&
X1 = 120
X2 = 4920
Y1 = 1680
Y2 = 1680
End
Begin VB.Label Label1
Caption = "请输入操作员代号和密码......"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 8
Top = 1320
Width = 3615
End
Begin VB.Label LblLoginName
AutoSize = -1 'True
Caption = "登录名:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 6
Top = 1920
Width = 915
End
Begin VB.Label LblPassword
AutoSize = -1 'True
Caption = "密 码:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 5
Top = 2520
Width = 930
End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public tNum As Integer
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub cmdLogin_Click()
On Error GoTo Err
Dim rd As Recordset
Dim i As Integer
Call CntDb
Set rd = gDbFish.OpenRecordset("select * from login_info")
i = 1
While Not rd.EOF
' rd.MoveFirst
If Trim(TxtLoginName.Text) = Trim(rd!login_id) Then
If Trim(TxtPassword.Text) = Trim(rd.Fields("password")) Then
user_type = Trim(rd.Fields("popedom")) '得到用户标识,以便确定用户权限
user_name = Trim(rd.Fields("user_name"))
Me.Hide
FrmMain.Show 1
Exit Sub
Else
MsgBox "您输入的密码不正确!", vbExclamation, "系统提示"
TxtPassword.Text = ""
TxtPassword.SetFocus
Exit Sub
End If
Else
rd.MoveNext
i = i + 1
End If
Wend
MsgBox "对不起,该用户不存在,请确认!", vbExclamation, "系统提示"
TxtLoginName.SetFocus
Err:
End Sub
Private Sub Form_Activate()
TxtLoginName.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Err
If MsgBox("你真的要退出系统?", vbQuestion + vbOKCancel, "提示信息") = vbCancel Then
Cancel = -1
Exit Sub
End If
End
Err:
End Sub
Private Sub LblLoginName_DblClick()
TxtPassword.PasswordChar = "*"
End Sub
Private Sub LblPassword_DblClick()
TxtPassword.PasswordChar = ""
TxtPassword.Text = TxtPassword.Text
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Dim tStr As String
If tNum < 6 Then
tNum = tNum + 1
Else
tNum = 1
End If
For i = 1 To tNum
tStr = tStr + "."
Next i
Label1.Caption = "请输入操作员代号和密码" + tStr
End Sub
Private Sub Timer2_Timer()
If Picture3.Visible = True Then
Picture2.Visible = False
Else
Picture2.Visible = True
End If
End Sub
Private Sub TxtLoginName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then TxtPassword.SetFocus
End Sub
Private Sub Txtpassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then CmdLogin.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -