?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "公司員工信息管理系統(tǒng)"
ClientHeight = 4125
ClientLeft = 45
ClientTop = 330
ClientWidth = 5910
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4125
ScaleWidth = 5910
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "注冊"
Height = 375
Left = 3720
TabIndex = 6
Top = 2880
Width = 1095
End
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 375
Left = 2400
TabIndex = 5
Top = 2880
Width = 975
End
Begin VB.CommandButton cmdOK
Caption = "確 定"
Default = -1 'True
Height = 375
Left = 1080
TabIndex = 4
Top = 2880
Width = 975
End
Begin VB.TextBox txtUser_pwd
Height = 375
IMEMode = 3 'DISABLE
Left = 2520
MaxLength = 8
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 2175
End
Begin VB.TextBox txtUser_id
Height = 375
Left = 2520
MaxLength = 8
TabIndex = 2
Top = 720
Width = 2175
End
Begin VB.Label lblPwd
Caption = "密 碼:"
Height = 255
Left = 1200
TabIndex = 1
Top = 1680
Width = 855
End
Begin VB.Label lblUser
Caption = "用戶名:"
Height = 255
Left = 1200
TabIndex = 0
Top = 720
Width = 855
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim tryCount As Integer
Private Sub Command1_Click()
frmUserAdd.Show vbModal
End Sub
Private Sub Form_Load()
Me.Icon = LoadPicture(App.Path & "\Graph07.ico")
tryCount = 0
End Sub
Private Sub cmdOK_Click()
Dim strSql As String
Dim rs As New ADODB.Recordset
If Trim(txtUser_id.Text = "") Then
MsgBox "用戶名不能為空,請重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
txtUser_id.SetFocus
txtUser_id.Text = ""
Else
strSql = "select user_pwd ,user_qx from sysuser where user_ID = '" & txtUser_id.Text & "'"
rs.Open strSql, dbConn, adOpenForwardOnly, adLockReadOnly
If rs.EOF Then
MsgBox "沒有這個(gè)用戶,請重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
txtUser_id.SetFocus
SendKeys "{HOME}"
SendKeys "+{end}"
Else
If Trim(rs.Fields("user_pwd")) = Trim(txtUser_pwd.Text) Then
tQx = rs.Fields("user_qx")
loginUser = txtUser_id.Text
loginOK = True
Me.Hide
tryCount = 1
Else
MsgBox "輸入密碼不正確,請重新輸入!", vbOKOnly + vbExclamation, "警告"
txtUser_pwd.SetFocus
txtUser_pwd.Text = ""
End If
End If
rs.Close
End If
Set rs = Nothing
tryCount = tryCount + 1
If tryCount = 3 Then
MsgBox "輸入不正確密碼達(dá)到三次,請重新啟動程序!", vbOKOnly + vbExclamation, "警告"
Me.Hide
Unload Me
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -