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

📄 frmlogin.frm

📁 考试系统:通过学生,教师,管理员三个身份可以登陆系统,教师和管理员有修改试卷的权限.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   AutoRedraw      =   -1  'True
   BorderStyle     =   0  'None
   Caption         =   "人员登录"
   ClientHeight    =   2100
   ClientLeft      =   2790
   ClientTop       =   3045
   ClientWidth     =   5175
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1240.749
   ScaleMode       =   0  'User
   ScaleWidth      =   4859.045
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   390
      Left            =   3840
      TabIndex        =   6
      Top             =   960
      Width           =   1140
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   390
      Left            =   3840
      TabIndex        =   5
      Top             =   360
      Width           =   1140
   End
   Begin VB.Frame FrameLog 
      Height          =   1815
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   3375
      Begin VB.ComboBox UTypes 
         Height          =   315
         ItemData        =   "frmLogin.frx":0000
         Left            =   1560
         List            =   "frmLogin.frx":000D
         Style           =   2  'Dropdown List
         TabIndex        =   8
         Top             =   1200
         Width           =   1455
      End
      Begin VB.TextBox txtPassword 
         Height          =   285
         IMEMode         =   3  'DISABLE
         Left            =   1200
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   720
         Width           =   1725
      End
      Begin VB.TextBox txtUserName 
         Height          =   285
         Left            =   1200
         TabIndex        =   3
         Top             =   240
         Width           =   1725
      End
      Begin VB.Label lblLabels 
         Caption         =   "人员类型"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   2
         Left            =   360
         TabIndex        =   7
         Top             =   1200
         Width           =   1080
      End
      Begin VB.Label lblLabels 
         Caption         =   "口令"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   1
         Left            =   360
         TabIndex        =   2
         Top             =   720
         Width           =   720
      End
      Begin VB.Label lblLabels 
         Caption         =   "姓名"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   0
         Left            =   360
         TabIndex        =   1
         Top             =   240
         Width           =   840
      End
   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 Sub CmdCancel_Click()
    Unload Me
End Sub

Private Sub CmdOk_Click()
    If txtUserName.Text = "" Then
        MsgBox "请输入姓名", vbCritical, "登录失败"
        txtUserName.SetFocus
        Exit Sub
    End If
    If txtPassword.Text = "" Then
        MsgBox "请输入口令", vbCritical, "登录失败"
        txtPassword.SetFocus
        Exit Sub
    End If
    
    Select Case UTypes.ListIndex
        Case 0
            TestUser.Log txtUserName, txtPassword, student
        Case 1
            TestUser.Log txtUserName, txtPassword, teacher
        Case 2
            TestUser.Log txtUserName, txtPassword, administrator
    End Select
    
    If Not TestUser.LogFail Then
        Unload Me
    Else
        MsgBox "无法登录, 请重试!", vbCritical, "用户登录"
        txtUserName.SetFocus
        SendKeys "{Home}+{End}"
    End If
End Sub

Private Sub Form_Load()
UTypes.ListIndex = 0
End Sub

⌨️ 快捷键说明

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