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

📄 frmlogin.frm

📁 学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmLogin 
   BackColor       =   &H00C0FFFF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "身份验证"
   ClientHeight    =   2850
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4500
   FillColor       =   &H0000C000&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2850
   ScaleWidth      =   4500
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   2760
      TabIndex        =   6
      Top             =   2160
      Width           =   1455
   End
   Begin VB.CommandButton Cmd_Ok 
      Caption         =   "确定"
      Height          =   375
      Left            =   480
      TabIndex        =   5
      Top             =   2160
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0FFC0&
      BorderStyle     =   0  'None
      Height          =   1815
      Left            =   480
      TabIndex        =   0
      Top             =   240
      Width           =   3735
      Begin VB.TextBox txtPwd 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   960
         Width           =   2055
      End
      Begin VB.TextBox txtUser 
         Height          =   375
         Left            =   1560
         TabIndex        =   3
         Top             =   240
         Width           =   2055
      End
      Begin VB.Label Label2 
         BackColor       =   &H00C0FFC0&
         Caption         =   "密码"
         Height          =   375
         Left            =   480
         TabIndex        =   2
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label1 
         BackColor       =   &H00C0FFC0&
         Caption         =   "用户名"
         Height          =   495
         Left            =   480
         TabIndex        =   1
         Top             =   360
         Width           =   975
      End
   End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public PasswordKey As String
Public NameKey As String
Public Try_times As Integer

Private Sub Cmd_Cancel_Click()
  End
End Sub

Private Sub Cmd_OK_Click()
  Dim j As Single

  '数据有效性检查
  If txtUser = "" Then
    MsgBox "请输入用户名"
    txtUser.SetFocus
    Exit Sub
  End If
  If txtPwd = "" Then
    MsgBox "请输入密码"
    txtPwd.SetFocus
    Exit Sub
  End If
  '将用户输入赋值到变量中
  NameKey = MakeStr(txtUser)
  PasswordKey = MakeStr(txtPwd)
  '判断用户是否存在
  If MyUser.In_DB(NameKey) = False Then
    MsgBox "用户名不存在"
    Try_times = Try_times + 1
    If Try_times >= 3 Then
      MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
      DBapi_Disconnect
      End
    Else
      Exit Sub
    End If
  End If
  '判断密码是否正确
  MyUser.GetInfo (NameKey)
  If MyUser.UserPwd <> PasswordKey Then
    MsgBox "密码错误"
    Try_times = Try_times + 1
    If Try_times >= 3 Then
      MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭"
      DBapi_Disconnect
      End
    Else
      Exit Sub
    End If
  End If
  '登录成功,将当前用户的信息保存在CurUser中
  CurUser.GetInfo (MyUser.UserName)
  FrmMain.Show
  
  '关闭登录对话框
  Unload Me
  
End Sub



⌨️ 快捷键说明

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