?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form FrmLogin
BorderStyle = 1 'Fixed Single
Caption = "身份驗證"
ClientHeight = 2130
ClientLeft = 45
ClientTop = 330
ClientWidth = 3975
ControlBox = 0 'False
Icon = "FrmLogin.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 2130
ScaleWidth = 3975
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Cancel
BackColor = &H80000000&
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 2235
MouseIcon = "FrmLogin.frx":0CCA
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 1560
Width = 1300
End
Begin VB.CommandButton Cmd_Ok
BackColor = &H80000000&
Caption = "確 定"
Default = -1 'True
Height = 400
Left = 435
MouseIcon = "FrmLogin.frx":0FD4
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 2
Top = 1560
Width = 1300
End
Begin VB.Frame Frame1
BackColor = &H80000000&
Height = 1215
Left = 240
TabIndex = 4
Top = 120
Width = 3495
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.TextBox txtUser
Height = 270
Left = 1080
MaxLength = 20
TabIndex = 0
ToolTipText = "輸入用戶名,不超過20個字符"
Top = 315
Width = 2175
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用戶名"
Height = 180
Left = 240
TabIndex = 6
Top = 360
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 碼"
Height = 180
Left = 240
TabIndex = 5
Top = 840
Width = 540
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 + -