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

📄 frmlogin.frm

📁 学生宿舍管理系统vb源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogIn 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "系统登录"
   ClientHeight    =   4485
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6000
   Icon            =   "frmLogIn.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MouseIcon       =   "frmLogIn.frx":F84A
   Picture         =   "frmLogIn.frx":FB54
   ScaleHeight     =   4485
   ScaleWidth      =   6000
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox txtPassword 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2400
      PasswordChar    =   "*"
      TabIndex        =   1
      Text            =   "grace"
      Top             =   2040
      Width           =   2535
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   2400
      TabIndex        =   0
      Text            =   "grace"
      Top             =   1560
      Width           =   2535
   End
   Begin VB.Label lblCancle 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Caption         =   "取   消"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   3840
      MouseIcon       =   "frmLogIn.frx":20524
      MousePointer    =   99  'Custom
      TabIndex        =   3
      Top             =   3120
      Width           =   1095
   End
   Begin VB.Label lblOk 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Caption         =   "确   定"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   2160
      MouseIcon       =   "frmLogIn.frx":2082E
      MousePointer    =   99  'Custom
      TabIndex        =   2
      Top             =   3120
      Width           =   1095
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "密   码"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   1200
      TabIndex        =   5
      Top             =   2040
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "用户名"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   1200
      TabIndex        =   4
      Top             =   1560
      Width           =   1095
   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()
    Me.Left = (Screen.Width - Me.Width) / 2         '设置窗体显示位置
    Me.Top = (Screen.Height - Me.Height) / 2        '设置窗体显示位置
End Sub

Private Sub lblCancle_Click()
    '按取消键退出系统
    End
End Sub

Private Sub lblOk_Click()
    Dim dbStr As String     '定义数据库查询语句变量
    Dim rst As New ADODB.Recordset  '定义数据记录集变量
    
    UserName = Trim(txtUserName)    '用户名
    dbStr = "select * from LoginIn where UserName='" & UserName & "'"
    Set rst = ExecuteSQL(dbStr, MsgString)  '执行SQL查询
    If rst.RecordCount < 1 Then '用户不存在
        rst.Close   '关闭数据库连接
        Set rst = Nothing
        MsgBox "用户名错误!", vbOKOnly + vbExclamation, "提示"
        Exit Sub
    End If
    rst.MoveFirst
    If Trim(txtPassword) <> Trim(rst.Fields("UserPassword").Value) Then '密码不匹配
        rst.Close
        Set rst = Nothing
        MsgBox "密码错误!", vbOKOnly + vbExclamation, "提示"
        Exit Sub
    End If
    frmMain.Show    '显示主窗体
    Unload Me
End Sub

⌨️ 快捷键说明

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