?? frm_xtdl.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_xtdl
BorderStyle = 1 'Fixed Single
Caption = "系統登錄"
ClientHeight = 2115
ClientLeft = 4245
ClientTop = 3435
ClientWidth = 3795
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2115
ScaleWidth = 3795
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "操作員信息"
Height = 1410
Left = 120
TabIndex = 2
Top = 195
Width = 3525
Begin VB.TextBox Txt_Password
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
IMEMode = 3 'DISABLE
Left = 1455
PasswordChar = "*"
TabIndex = 4
Top = 900
Width = 1875
End
Begin VB.ComboBox Op_Name
Height = 300
Left = 1455
TabIndex = 3
Top = 390
Width = 1875
End
Begin VB.Label Label2
Caption = "操作員口令:"
Height = 270
Left = 165
TabIndex = 6
Top = 960
Width = 1185
End
Begin VB.Label Label1
Caption = "操作員名稱:"
Height = 270
Left = 165
TabIndex = 5
Top = 450
Width = 1185
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 300
Top = 4185
Width = 2175
_ExtentX = 3836
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
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.CommandButton Cmd_Ok
Caption = "確定"
Height = 320
Left = 1785
TabIndex = 0
Top = 1665
Width = 875
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 320
Left = 2770
TabIndex = 1
Top = 1665
Width = 875
End
End
Attribute VB_Name = "frm_xtdl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim itmX As ListItem '定義一個ListItem對象
Dim key As String '定義字符串變量
Private Sub Cmd_Cancel_Click()
End
End Sub
'用戶登錄按鈕的事件代碼
Private Sub Cmd_Ok_Click()
Adodc1.RecordSource = "select * from 用戶信息 where 用戶名 ='" & Op_Name.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MPassword = Adodc1.Recordset.Fields("密碼")
If Txt_Password.Text = MPassword Then '判斷數據的密碼是否正確
Name1 = Op_Name.Text
Frm_Main.StatusBar1.Panels.Item(2).Text = "當前操作員: " + Adodc1.Recordset.Fields("用戶名")
Frm_Main.Show '通過身份驗證則顯示主窗體,登錄到系統當中
Unload Me
Else
MsgBox "密碼不正確,請您確認后重新輸入", , "提示信息"
Txt_Password.Text = ""
Txt_Password.SetFocus
End If
Else
MsgBox "對不起 沒有此用戶的信息", , "提示信息"
Op_Name.Text = ""
Txt_Password.Text = ""
End If
End Sub
Private Sub Form_Load()
'使用代碼連接數據庫與數據表
Adodc1.ConnectionString = MyStrs
Adodc1.RecordSource = "select * from 用戶信息"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Op_Name.Clear '在添加數據時,首先清空控件中的內容
Do While Adodc1.Recordset.EOF = False '將操作員信息添加到下拉列表框控件當中
Op_Name.AddItem (Adodc1.Recordset.Fields("用戶名"))
Adodc1.Recordset.MoveNext
Loop
End If
End Sub
Private Sub Label3_Click()
End Sub
Private Sub Txt_Password_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Cmd_Ok_Click '調用確定按鈕的單擊事件代碼
End If
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Txt_Password.SetFocus
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -