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

📄 frmlogin.frm

📁 人事管理系统dephel+access实现了一些简单的员工
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00C0C0FF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Login"
   ClientHeight    =   5040
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   7515
   Icon            =   "frmLogin.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2977.799
   ScaleMode       =   0  'User
   ScaleWidth      =   7056.178
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.ComboBox Combo1 
      Appearance      =   0  'Flat
      Height          =   300
      Left            =   3480
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   2400
      Width           =   2295
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确认"
      Default         =   -1  'True
      Height          =   390
      Left            =   2520
      TabIndex        =   1
      Top             =   3720
      Width           =   1140
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   390
      Left            =   4440
      TabIndex        =   2
      Top             =   3720
      Width           =   1140
   End
   Begin VB.TextBox txtPassword 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   3480
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   3000
      Width           =   2205
   End
   Begin VB.Frame Frame1 
      Caption         =   "登陆"
      Height          =   2055
      Left            =   2040
      TabIndex        =   5
      Top             =   2160
      Width           =   3975
      Begin VB.Label Label3 
         Caption         =   "密码:"
         Height          =   255
         Left            =   480
         TabIndex        =   7
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "用户名:"
         Height          =   255
         Left            =   480
         TabIndex        =   6
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "人 事 管 理 系 统"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   42
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   1095
      Left            =   720
      TabIndex        =   8
      Top             =   360
      Width           =   6495
   End
   Begin VB.Image Image2 
      Height          =   75
      Left            =   0
      Picture         =   "frmLogin.frx":0742
      Top             =   1680
      Width           =   8100
   End
   Begin VB.Image Image1 
      Height          =   1650
      Left            =   0
      Picture         =   "frmLogin.frx":1E43
      Top             =   0
      Width           =   10575
   End
   Begin VB.Label Label1 
      Caption         =   "        欢迎使用本系统  。^_^ 。"
      Height          =   375
      Left            =   2400
      TabIndex        =   4
      Top             =   4440
      Width           =   3495
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const MxUser = 100
Public EmploID As Integer
Public CurUser As String
Public CurId As String
Public CurPsw As String
Dim user(MxUser), pws(MxUser), state(MxUser), Emplo(MxUser) As String



Private Sub Form_Load()

Dim i As Integer
     
      If App.PrevInstance Then
         MsgBox ("程序已经运行,不能再次装载。"), vbExclamation
         Unload Me
      End If
      '本段代码用于判定本程序是否已经装载于内存中,以避免程序的多重启动
        
        i = 0
    
      Open App.Path + "\user.ini" For Input As #1
    
        Do While Not EOF(1)
             Input #1, user(i), pws(i), state(i), Emplo(i)
                 
            If state(i) = "A" Then
                Combo1.AddItem user(i)
            End If
                i = i + 1
        Loop
            
            Close #1
            Combo1.ListIndex = 1

   '在窗口装载阶段读取用户设置文件获取用户信息 并装载于用户列表框中

End Sub

Private Sub CmdCancel_Click()
    
    Unload Me
    End
   
End Sub

Private Sub cmdOK_Click()

   If txtPassword = pws(Combo1.ListIndex) Then
        
        CurId = Combo1.ListIndex
        EmploID = Emplo(CurId)
        CurUser = user(CurId)
        CurPsw = pws(CurId)
        
        Me.Hide
        
        'Load FrmMain
        FrmMain.Show
   Else
        
        MsgBox "Invalid Password, try again!", , "Login"
        txtPassword.SetFocus
        SendKeys "{Home}+{End}"
    End If
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Unload Me
    End
End Sub

⌨️ 快捷键说明

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