?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登錄"
ClientHeight = 1920
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 4575
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmLogin.frx":0442
ScaleHeight = 1134.399
ScaleMode = 0 'User
ScaleWidth = 4295.676
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "退 出"
Height = 390
Left = 3120
TabIndex = 2
Top = 1320
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "登 錄"
Default = -1 'True
Height = 390
Left = 3120
TabIndex = 1
Top = 840
Width = 1140
End
Begin VB.ComboBox txtUserName
Height = 300
Left = 1200
TabIndex = 3
Top = 840
Width = 1815
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 0
Top = 1320
Width = 1725
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\My Documents\ZQH\VB\mis\mis.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 375
Left = 960
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "PASSWORD"
Top = 1800
Visible = 0 'False
Width = 1500
End
Begin VB.Frame Frame1
BorderStyle = 0 'None
Height = 1095
Left = 120
TabIndex = 5
Top = 720
Width = 4335
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "密碼(&P):"
Height = 180
Left = 120
TabIndex = 7
Top = 600
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "用戶名(&U):"
Height = 180
Left = 120
TabIndex = 6
Top = 120
Width = 900
End
End
Begin VB.Label Label1
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H00C0FFC0&
Caption = "歡迎進(jìn)入圖書管理系統(tǒng)"
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 435
Left = 120
TabIndex = 4
Top = 120
Width = 4350
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click() '登錄
Dim i As Integer
Dim mark As Boolean
mark = False
'檢查正確的密碼
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
For i = 1 To Data1.Recordset.RecordCount
If txtUserName.text = Data1.Recordset.Fields("UserName") Then
mark = True
If txtPassword.text = Data1.Recordset.Fields("PW") Then
txtPassword.text = ""
Form1.Show (1)
Exit Sub
Else
MsgBox "無效的密碼,請重試!", 48, "登錄"
txtPassword.SetFocus
Exit Sub
End If
End If
Data1.Recordset.MoveNext
Next i
If mark = False Then
MsgBox "該用戶不存在,請重新輸入用戶名!", 48, "登錄"
txtUserName.SetFocus
Exit Sub
End If
End Sub
Private Sub Form_Load()
txtUserName.Clear
Dim i As Integer
txtUserName.text = "Administrator"
Data1.DatabaseName = App.Path + "\mis.mdb"
Data1.RecordSource = "PASSWORD"
Data1.Refresh
'初始化用戶名列表框
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
For i = 1 To Data1.Recordset.RecordCount
txtUserName.AddItem Data1.Recordset.Fields("UserName")
Data1.Recordset.MoveNext
Next i
txtUserName.text = "Administrator"
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -