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

📄 frmlogin.frm

📁 教学管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   BackColor       =   &H80000001&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "登陆教学管理系统"
   ClientHeight    =   3255
   ClientLeft      =   4590
   ClientTop       =   3855
   ClientWidth     =   5925
   Icon            =   "frmLogin.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3255
   ScaleWidth      =   5925
   Begin VB.TextBox txtPassword 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2520
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1800
      Width           =   3135
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&C)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      MouseIcon       =   "frmLogin.frx":0BF2
      MousePointer    =   99  'Custom
      TabIndex        =   5
      Top             =   2640
      Width           =   1455
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定(&O)"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2400
      MouseIcon       =   "frmLogin.frx":0EFC
      MousePointer    =   99  'Custom
      TabIndex        =   4
      Top             =   2640
      Width           =   1455
   End
   Begin VB.ComboBox cmbName 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "frmLogin.frx":1206
      Left            =   2520
      List            =   "frmLogin.frx":1210
      TabIndex        =   1
      Top             =   1080
      Width           =   3135
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "欢迎进入教学管理系统!"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000F&
      Height          =   495
      Left            =   315
      TabIndex        =   6
      Top             =   120
      Width           =   5295
   End
   Begin VB.Image Image1 
      Height          =   720
      Left            =   240
      Picture         =   "frmLogin.frx":1225
      Top             =   1080
      Width           =   720
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "密码(&P):"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000F&
      Height          =   255
      Left            =   960
      TabIndex        =   2
      Top             =   1800
      Width           =   1455
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "用户名(&N):"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000F&
      Height          =   255
      Left            =   960
      TabIndex        =   0
      Top             =   1080
      Width           =   1455
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim IptPassword As String
Dim IptUserName As String
Dim sql As String

Private Sub cmdCancel_Click()
    txtPassword.text = ""
End Sub

Private Sub cmdOK_Click()
    IptPassword = txtPassword.text
    IptUserName = cmbName.text
    sql = "select PASSWORD,LIMIT from users where USERNAME ='" + IptUserName + "'"
    cn.exeSQL sql, rs

    If rs.RecordCount <> 0 Then
        If IptPassword = rs.Fields(0).Value Then
            UserName = IptUserName
            Password = IptPassword
            Limit = rs.Fields(1).Value
            
            Select Case Limit
            '取得用户真实姓名
                Case 1
                    sql = "select userno,usertruename from studentuser where username ='" + UserName + "'"
                    cn.exeSQL sql, rs
                    UserNO = rs.Fields(0).Value
                    UserTrueName = rs.Fields(1).Value
                Case Else
                    sql = "select userno,usertruename from teacheruser where username ='" + UserName + "'"
                    cn.exeSQL sql, rs
                    UserNO = rs.Fields(0).Value
                    UserTrueName = rs.Fields(1).Value
            End Select
            Dim Main As New frmMain
            Main.Show
            Unload Me
        Else
            MsgBox "用户名或密码错误"
            txtPassword.text = ""
        End If
    Else
        MsgBox "用户名或密码错误"
        txtPassword.text = ""
    End If
    
End Sub

Private Sub Form_Load()
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenStatic
End Sub

Private Sub Form_Terminate()
    Unload Me
End Sub

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

⌨️ 快捷键说明

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