?? form1.frm
字號:
VERSION 5.00
Begin VB.Form form1
BackColor = &H00808080&
Caption = "系統登錄"
ClientHeight = 2265
ClientLeft = 60
ClientTop = 345
ClientWidth = 5490
Icon = "form1.frx":0000
LinkTopic = "Form1"
Picture = "form1.frx":030A
ScaleHeight = 2265
ScaleWidth = 5490
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox master
Height = 300
Left = 2250
TabIndex = 5
Top = 360
Width = 1935
End
Begin VB.CommandButton Cmdexit
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 400
Left = 3045
Style = 1 'Graphical
TabIndex = 2
Top = 1530
Width = 1365
End
Begin VB.CommandButton Cmdok
BackColor = &H00C0C0C0&
Caption = "確定"
Height = 400
Left = 1665
MaskColor = &H00FF8080&
Style = 1 'Graphical
TabIndex = 0
Top = 1530
UseMaskColor = -1 'True
Width = 1365
End
Begin VB.TextBox password
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
IMEMode = 3 'DISABLE
Left = 2250
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 795
Width = 1905
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 碼: "
BeginProperty Font
Name = "黑體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 1335
TabIndex = 4
Top = 810
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "操作員: "
BeginProperty Font
Name = "黑體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1335
TabIndex = 3
Top = 330
Width = 1095
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim TIM As Integer
Dim mydb As Database
Dim myrs As Recordset
Dim sql As String
Private Sub Form_Activate()
Set mydb = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb") '打開數據庫
sql = "select 操作員 from qxsz"
Set myrs = mydb.OpenRecordset(sql)
If myrs.EOF = False Then myrs.MoveLast
If myrs.BOF = False Then myrs.MoveFirst
For i = 0 To myrs.RecordCount - 1
master.AddItem (myrs.Fields(0))
myrs.MoveNext
Next i
If master.ListCount > 0 Then master.ListIndex = 0
myrs.Close
mydb.Close
master.SetFocus
End Sub
Private Sub Cmdok_Click() '確認操作員和密碼
Dim MESSAGE As String
If master.Text <> "" Then
Set mydb = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb")
Set myrs = mydb.OpenRecordset("qxsz", dbOpenDynaset)
myrs.FindFirst "操作員 = " + Chr(34) + master.Text + Chr(34) + "" ' 查找操作員
If myrs.NoMatch Then '沒查到記錄
MsgBox ("無此操作員!")
Else
If password.Text = myrs.Fields("密碼") Then '確認密碼
MsgBox "系統登陸成功!" '系統登錄成功
Else
If TIM = 3 Then
MESSAGE = MsgBox("密碼輸入錯誤,請向系統管理員查詢!", 0, "")
If MESSAGE = vbOK Then End
End If
MsgBox ("密碼錯誤,請重新輸入密碼!")
TIM = TIM + 1 '密碼輸入錯誤次數
password.SetFocus
End If
End If
End If
End Sub
Private Sub master_KeyDown(KeyCode As Integer, Shift As Integer) '回車換行
If KeyCode = vbKeyReturn Then
password.SetFocus
End If
End Sub
Private Sub password_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Cmdok.Visible = True
Cmdok.SetFocus
End If
If KeyCode = vbKeyDown Then
Cmdok.Visible = True
Cmdok.SetFocus
End If
If KeyCode = vbKeyUp Then
master.SetFocus
End If
End Sub
Private Sub Cmdexit_Click()
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -