?? frmlogin.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登錄"
ClientHeight = 2040
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 4050
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1205.299
ScaleMode = 0 'User
ScaleWidth = 3802.731
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text3
Height = 375
Left = 3360
TabIndex = 6
Text = "Text3"
Top = 1200
Visible = 0 'False
Width = 375
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 240
Top = 1680
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=ais"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "ais"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "用戶表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox text1
Height = 345
Left = 1290
TabIndex = 1
Top = 240
Width = 2325
End
Begin VB.CommandButton command1
Caption = "確定"
Default = -1 'True
Height = 390
Left = 720
TabIndex = 4
Top = 1320
Width = 1140
End
Begin VB.CommandButton command2
Cancel = -1 'True
Caption = "取消"
Height = 390
Left = 2040
TabIndex = 5
Top = 1320
Width = 1140
End
Begin VB.TextBox text2
Height = 345
IMEMode = 3 'DISABLE
Left = 1290
PasswordChar = "*"
TabIndex = 3
Top = 720
Width = 2325
End
Begin VB.Label label1
Caption = "用戶名稱(&U):"
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 360
Width = 1080
End
Begin VB.Label label2
Caption = "密碼(&P):"
Height = 270
Index = 1
Left = 105
TabIndex = 2
Top = 840
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim appuser As String
Dim appassw As String
Dim entertime As Integer
Private Sub Command1_Click()
Call confirm
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub form_load()
entertime = 0
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call confirm
End If
End Sub
Sub confirm()
entertime = entertime + 1
If entertime > 3 Then
MsgBox "輸入次數(shù)大于3次,系統(tǒng)自動退出……"
Unload Me
Else
appuser = Text1.Text
Adodc1.Recordset.Find "name='" + appuser + "'"
If Adodc1.Recordset.EOF Then '沒有找到該用戶
MsgBox "用戶名或密碼錯誤,請重新輸入……"
Text1.Text = ""
Else '用戶名正確,核對密碼
If Adodc1.Recordset.Fields("password") = Text2.Text Then
main.Show
Unload Me
Else
MsgBox "密碼錯誤,請重新輸入……"
Text2.Text = ""
End If
End If
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -