📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form FrmLogin
BorderStyle = 1 'Fixed Single
Caption = "欢迎登陆!"
ClientHeight = 3090
ClientLeft = 45
ClientTop = 435
ClientWidth = 4680
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
BackColor = &H8000000B&
Height = 2535
Left = 360
TabIndex = 0
Top = 240
Width = 3975
Begin VB.TextBox TxtPwd
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 6
Text = "Admin"
Top = 1200
Width = 2055
End
Begin VB.CommandButton Cmd_Cancel
BackColor = &H80000010&
Caption = "取 消"
Height = 495
Left = 2400
TabIndex = 5
Top = 1920
Width = 1215
End
Begin VB.CommandButton Cmd_OK
BackColor = &H8000000C&
Caption = "确 定"
Height = 495
Left = 360
MaskColor = &H000000C0&
TabIndex = 4
Top = 1920
Width = 1215
End
Begin VB.TextBox TxtUser
Height = 375
Left = 1560
TabIndex = 3
Text = "Admin"
Top = 360
Width = 2055
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 码:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 2
Top = 1320
Width = 1455
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 1
Top = 360
Width = 1335
End
End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public PasswordKey As String
Public NameKey As String
Public Try_times As Integer
Private Sub Cmd_Cancel_Click()
End
End Sub
Private Sub Cmd_OK_Click()
Dim j As Single
'数据有效性检查
If TxtUser = "" Then
MsgBox "请输入用户名"
TxtUser.SetFocus
Exit Sub
End If
If TxtPwd = "" Then
MsgBox "请输入密码"
TxtPwd.SetFocus
Exit Sub
End If
NameKey = MakeStr(TxtUser)
PasswordKey = MakeStr(TxtPwd)
'判断用户是否存在
If MyUser.In_DB(NameKey) = False Then
MsgBox "用户名不存在"
Try_times = Try_times + 1
If Try_times >= 3 Then
MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
DBapi_Disconnect
End
Else
Exit Sub
End If
End If
'判断密码是否正确
MyUser.GetInfo (NameKey)
If MyUser.UserPwd <> PasswordKey Then
MsgBox "密码错误"
Try_times = Try_times + 1
If Try_times >= 3 Then
MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
DBapi_Disconnect
End
Else
Exit Sub
End If
End If
'登录成功,将当前用户的信息保存在CurUser中
CurUser.GetInfo (NameKey)
'关闭自己
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -