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

📄 frmlogin.frm

📁 一套比较完整的VB开发的员工请假管理系统
💻 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
'Download by http://www.codefans.net
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 + -