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

📄 frmlogin.frm

📁 小小图书管理系统是功能完善,已经可以实用于小型单位或科室的图书管理.系统界面美观,操作方便,代码带有详尽的注释,相信大家一定会喜欢
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   Appearance      =   0  'Flat
   AutoRedraw      =   -1  'True
   BackColor       =   &H80000005&
   BorderStyle     =   0  'None
   Caption         =   "用户登录"
   ClientHeight    =   4500
   ClientLeft      =   4920
   ClientTop       =   2595
   ClientWidth     =   6075
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   300
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   405
   ShowInTaskbar   =   0   'False
   Begin Project1.xp_canvas xp_canvas1 
      Height          =   4500
      Left            =   0
      TabIndex        =   4
      Top             =   0
      Width           =   6135
      _ExtentX        =   10821
      _ExtentY        =   11033
      Caption         =   "用户登录"
      Icon            =   "frmLogin.frx":0000
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3000
         TabIndex        =   1
         Text            =   "Reader"
         Top             =   1200
         Width           =   1815
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   3000
         PasswordChar    =   "*"
         TabIndex        =   2
         Text            =   "111"
         Top             =   2160
         Width           =   1815
      End
      Begin VB.Frame Frame1 
         Height          =   2295
         Left            =   600
         TabIndex        =   5
         Top             =   720
         Width           =   4575
         Begin VB.Label Label2 
            Caption         =   "  密  码"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   480
            TabIndex        =   7
            Top             =   1440
            Width           =   1455
         End
         Begin VB.Label Label1 
            Caption         =   " 用 户 名"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   480
            TabIndex        =   6
            Top             =   480
            Width           =   1455
         End
      End
      Begin Project1.xpcmdbutton xpcmdbutton2 
         Height          =   495
         Left            =   3240
         TabIndex        =   0
         Top             =   3360
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   873
         Caption         =   "退出系统"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin Project1.xpcmdbutton xpcmdbutton1 
         Height          =   495
         Left            =   1080
         TabIndex        =   3
         Top             =   3360
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   873
         Caption         =   "登录系统"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin Project1.xptopbuttons xptopbuttons1 
         Height          =   315
         Left            =   5760
         ToolTipText     =   "关闭系统"
         Top             =   120
         Width           =   315
         _ExtentX        =   556
         _ExtentY        =   556
      End
      Begin Project1.xphelp xphelp1 
         Height          =   315
         Left            =   5400
         ToolTipText     =   "帮助"
         Top             =   120
         Width           =   315
         _ExtentX        =   556
         _ExtentY        =   556
      End
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False




Private Sub Form_Load()             '连接用户表
Call open_connection("user_table")
End Sub

Private Sub Form_Resize()
    xp_canvas1.Height = Me.ScaleHeight
    xp_canvas1.Width = Me.ScaleWidth
    xp_canvas1.make_trans Me
    
End Sub



Private Sub xpcmdbutton1_Click()     '登录系统
Dim sql As String

If Trim(Text1.Text) = "" Then        '如果文本框为空,则给出提示
  frmMsg.Show
   frmMsg.notice.Visible = True
  frmMsg.Text1.Text = "请输入用户登录账号!"
   Exit Sub
Else
  sql = "select * from user_table where [登录名]='" & Trim(Text1.Text) & "'"   '查找用户登录名
  rst.Close
  rst.Open sql, con, adOpenDynamic, adLockOptimistic
     If rst.RecordCount <= 0 Then
      frmMsg.Show
     frmMsg.error.Visible = True
  frmMsg.Text1.Text = "用户名不存在!"
       Exit Sub
     End If
     '用户合法性检测并赋予一定的权限级别
    If LCase(Trim(rst![登录名])) = LCase(Trim(Text1.Text)) Then
      If Trim(rst![密码]) = Trim(Text2.Text) Then
        privilege = rst![权限]
        Call check_privage(privilege)   '权限分配
       Else
        frmMsg.Show
          frmMsg.error.Visible = True
       frmMsg.Text1.Text = "密码错误,请重新输入!"
        Exit Sub
       End If
   End If
End If
End Sub


 
Private Sub xpcmdbutton2_Click()    '退出系统
End
End Sub

Private Sub xptopbuttons1_Click()
End
End Sub

⌨️ 快捷键说明

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