?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form FrmLogin
BorderStyle = 1 'Fixed Single
Caption = "身份驗(yàn)證"
ClientHeight = 2055
ClientLeft = 45
ClientTop = 330
ClientWidth = 3975
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2055
ScaleWidth = 3975
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
BackColor = &H80000000&
Height = 1215
Left = 240
TabIndex = 4
Top = 0
Width = 3495
Begin VB.TextBox txtUser
Height = 270
Left = 1080
MaxLength = 20
TabIndex = 0
ToolTipText = "輸入用戶名,不超過20個(gè)字符"
Top = 315
Width = 2175
End
Begin VB.TextBox txtPwd
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 20
PasswordChar = "*"
TabIndex = 1
ToolTipText = "輸入密碼,不超過20個(gè)字符"
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
BackColor = &H80000000&
Caption = "確 定"
Default = -1 'True
Height = 400
Left = 437
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 2
Top = 1440
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
BackColor = &H80000000&
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 2237
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 1440
Width = 1300
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
'數(shù)據(jù)有效性檢查
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 "您已經(jīng)三次嘗試進(jìn)入本系統(tǒng),均不成功,系統(tǒng)將關(guān)閉"
DBapi_Disconnect
End
Else
Exit Sub
End If
End If
'判斷密碼是否正確
MyUser.GetInfo (NameKey)
If MyUser.Pwd <> PasswordKey Then
MsgBox "密碼錯(cuò)誤"
Try_times = Try_times + 1
If Try_times >= 3 Then
MsgBox "您已經(jīng)三次嘗試進(jìn)入本系統(tǒng),均不成功,系統(tǒng)將關(guān)閉"
DBapi_Disconnect
End
Else
Exit Sub
End If
End If
'登錄成功,將當(dāng)前用戶的信息保存在CurUser中
CurUser.GetInfo (MyUser.UserName)
'關(guān)閉登錄對話框
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -