📄 login.frm
字号:
VERSION 5.00
Begin VB.Form Login
BackColor = &H80000016&
BorderStyle = 5 'Sizable ToolWindow
Caption = "登录"
ClientHeight = 2160
ClientLeft = 60
ClientTop = 300
ClientWidth = 3990
ControlBox = 0 'False
Icon = "Login.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 2160
ScaleWidth = 3990
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
BackColor = &H80000000&
Height = 1215
Left = 240
TabIndex = 4
Top = 120
Width = 3495
Begin VB.TextBox txtUser
Height = 270
Left = 1080
MaxLength = 20
TabIndex = 0
ToolTipText = "输入用户名,不超过20个字符"
Top = 315
Width = 2175
End
Begin VB.TextBox txtPwd
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 20
PasswordChar = "*"
TabIndex = 1
ToolTipText = "输入密码,不超过20个字符"
Top = 795
Width = 2175
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码"
Height = 180
Left = 240
TabIndex = 6
Top = 840
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名"
Height = 180
Left = 240
TabIndex = 5
Top = 360
Width = 540
End
End
Begin VB.CommandButton Cmd_Ok
Appearance = 0 'Flat
BackColor = &H80000000&
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 435
MouseIcon = "Login.frx":27A2
MousePointer = 99 'Custom
TabIndex = 2
Top = 1560
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
Appearance = 0 'Flat
BackColor = &H80000000&
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 2235
MouseIcon = "Login.frx":2AAC
MousePointer = 99 'Custom
TabIndex = 3
Top = 1560
Width = 1300
End
End
Attribute VB_Name = "Login"
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.Pwd <> 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.GetInfo (MyUser.UserName)
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -