?? frmlogin.frm
字號:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmLogin
BorderStyle = 0 'None
Caption = "員工請假管理"
ClientHeight = 2430
ClientLeft = 0
ClientTop = 0
ClientWidth = 5040
LinkTopic = "Form1"
ScaleHeight = 2430
ScaleWidth = 5040
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSDataListLib.DataCombo dcmbOperName
Height = 330
Left = 2040
TabIndex = 1
Top = 1080
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin VB.CommandButton cmdCancel
BackColor = &H00FFFFFF&
Caption = "取消"
Height = 375
Left = 3840
Style = 1 'Graphical
TabIndex = 4
Top = 1680
Width = 975
End
Begin VB.TextBox txtOperPass
Height = 270
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 2
Top = 1680
Width = 1575
End
Begin VB.CommandButton cmdOK
BackColor = &H00FFFFFF&
Caption = "確定"
Height = 375
Left = 3840
Style = 1 'Graphical
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.CommandButton cmdClose
Appearance = 0 'Flat
BackColor = &H80000018&
Caption = "X"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 4680
MaskColor = &H00F9FDE6&
Style = 1 'Graphical
TabIndex = 5
Top = 0
UseMaskColor = -1 'True
Width = 375
End
Begin VB.Label lblWarning
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "初始化用戶名admin,密碼 1"
ForeColor = &H000000FF&
Height = 180
Left = 120
TabIndex = 8
Top = 2160
Width = 2400
End
Begin VB.Label lblOperPass
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "操作密碼"
ForeColor = &H80000008&
Height = 180
Left = 1200
TabIndex = 7
Top = 1680
Width = 720
End
Begin VB.Label lblOperName
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "操作員工"
ForeColor = &H80000008&
Height = 180
Left = 1200
TabIndex = 6
Top = 1200
Width = 720
End
Begin VB.Label lblTitel
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "系統登錄"
ForeColor = &H80000008&
Height = 180
Left = 120
TabIndex = 0
Top = 120
Width = 720
End
Begin VB.Image ImgLogin
Height = 3135
Left = 0
Picture = "frmLogin.frx":0000
Top = 0
Width = 5040
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private logintestCount As Integer '記錄錯誤的登錄次數
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim strSql As String
strSql = " Oper_ID = " & "'" & dcmbOperName.BoundText & "'"
If Not (rctOperatorList.EOF And rctOperatorList.BOF) Then
rctOperatorList.Find (strSql)
If Not (rctOperatorList.EOF Or rctOperatorList.BOF) Then
If Trim(rctOperatorList.Fields("Oper_Pass")) = Trim(txtOperPass.Text) Then
OperaterName = Trim(dcmbOperName.Text) '記錄當前用戶
frmMain.Show '顯示主窗體
Unload Me
Exit Sub
Else
logintestCount = logintestCount + 1
If logintestCount >= 3 Then
MsgBox "您已經登錄三次都失敗,系統關閉", vbInformation + vbOKOnly, "非法用戶"
Unload Me
Exit Sub
Else
txtOperPass.SetFocus
End If
End If
Else
logintestCount = logintestCount + 1
If logintestCount >= 3 Then
MsgBox "您已經登錄三次都失敗,系統關閉", vbInformation + vbOKOnly, "非法用戶"
Unload Me
Exit Sub
Else
txtOperPass.SetFocus
End If
End If
Else
MsgBox "數據庫中沒有操作用戶數據", vbCritical + vbOKOnly, "系統錯誤"
Unload Me
Exit Sub
End If
End Sub
Private Sub Form_Load()
cmdClose.BackColor = RGB(236, 226, 216)
cmdOK.BackColor = RGB(209, 215, 231)
cmdCancel.BackColor = RGB(209, 215, 231)
If ExcuteSql(rctOperatorList, "select * from OperatorList") = True Then
'
Set dcmbOperName.RowSource = rctOperatorList
dcmbOperName.BoundColumn = "Oper_ID"
dcmbOperName.ListField = "OPer_Name"
dcmbOperName.BoundText = "01"
Else
MsgBox "打開數據庫失敗,系統關閉!", vbCritical + vbOKOnly, "初始化錯誤"
Unload Me
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -