?? frm_xtdl.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_xtdl
BorderStyle = 0 'None
Caption = "系統登錄"
ClientHeight = 3780
ClientLeft = 4200
ClientTop = 3000
ClientWidth = 5880
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frm_xtdl.frx":0000
ScaleHeight = 3780
ScaleWidth = 5880
ShowInTaskbar = 0 'False
Begin VB.ComboBox Cbx_Name
Height = 300
Left = 1590
TabIndex = 3
Text = "MR"
Top = 2370
Width = 1320
End
Begin VB.TextBox Txt_Password
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
IMEMode = 3 'DISABLE
Left = 3975
PasswordChar = "*"
TabIndex = 2
Top = 2370
Width = 1350
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 = 3540
TabIndex = 0
Top = 2925
Width = 875
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 320
Left = 4575
TabIndex = 1
Top = 2925
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()
Dim MPassword As String
If Cbx_Name.Text = "MR" And Txt_Password.Text = "mingrisoft" Then '判斷是否使用的是超級口令登錄
Frm_Main.StatusBar1.Panels.Item(2).Text = "當前操作員: MR"
Name1 = Cbx_Name.Text '將操作員姓名信息賦予全局變量Name1
Unload Me
Frm_Main.Show '顯示系統主窗體
Else
Adodc1.RecordSource = "select * from tb_user where user_name ='" & Cbx_Name.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MPassword = Adodc1.Recordset.Fields("user_mm")
If Txt_Password.Text = MPassword Then '判斷數據的密碼是否正確
Name1 = Cbx_Name.Text
Frm_Main.StatusBar1.Panels.Item(2).Text = "當前操作員: " + Adodc1.Recordset.Fields("user_name")
Frm_Main.Show '通過身份驗證則顯示主窗體,登錄到系統當中
Unload Me
Else
MsgBox "密碼不正確,請您確認后重新輸入", , "提示信息"
Txt_Password.Text = ""
Txt_Password.SetFocus
End If
Else
MsgBox "對不起 沒有此用戶的信息", , "提示信息"
Cbx_Name.Text = ""
Txt_Password.Text = ""
End If
End If
End Sub
Private Sub Form_Load()
Call WHScreen '調用獲取屏幕分辨率的過程函數
'使用代碼連接數據庫與數據表
Adodc1.ConnectionString = PublicStr
Adodc1.RecordSource = "select * from tb_user"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Cbx_Name.Clear '在添加數據時,首先清空控件中的內容
Do While Adodc1.Recordset.EOF = False '將操作員信息添加到ListView控件當中
Cbx_Name.AddItem (Adodc1.Recordset.Fields("user_name"))
Adodc1.Recordset.MoveNext
Loop
End If
If TWidth <= 800 Or THeigth <= 600 Then '判斷屏幕分辨率的大小
Exit Sub
Else
ChangeScreen '調整屏幕分辨率
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
Private Sub ChangeScreen() '改變屏幕分辨率函數
MsgBox "您桌面的分辨率并不是800*600,建議您將桌面的分辨率調整成800*600之后,再運行此程序!", 64, "提示信息"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -