⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmlogin.frm

📁 员工信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "公司员工信息管理系统"
   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 "没有这个用户,请重新输入用户名!", 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 "输入不正确密码达到三次,请重新启动程序!", vbOKOnly + vbExclamation, "警告"
        Me.Hide
        Unload Me
    End If
    
End Sub

Private Sub cmdCancel_Click()
   Unload Me
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -