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

📄 frmlogin.frm

📁 酒店管理系统 基于VB和SQL的一个很好的程序 可以实现酒店的日常管理工作
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmLogin 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "身份验证"
   ClientHeight    =   2715
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3975
   ControlBox      =   0   'False
   Icon            =   "FrmLogin.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   2715
   ScaleWidth      =   3975
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   600
      Top             =   2280
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   $"FrmLogin.frx":0CCA
      OLEDBString     =   $"FrmLogin.frx":0D53
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "SELECT * FROM Users ORDER BY UserId"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_Cancel 
      BackColor       =   &H80000000&
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   2235
      MouseIcon       =   "FrmLogin.frx":0DDC
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1560
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Ok 
      BackColor       =   &H80000000&
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   435
      MouseIcon       =   "FrmLogin.frx":10E6
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1560
      Width           =   1300
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H80000000&
      Height          =   1215
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   3495
      Begin VB.TextBox txtPwd 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   1080
         MaxLength       =   20
         PasswordChar    =   "*"
         TabIndex        =   1
         ToolTipText     =   "输入密码,不超过20个字符"
         Top             =   795
         Width           =   2175
      End
      Begin VB.TextBox txtUser 
         Height          =   270
         Left            =   1080
         MaxLength       =   20
         TabIndex        =   0
         ToolTipText     =   "输入用户名,不超过20个字符"
         Top             =   315
         Width           =   2175
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "用户名"
         Height          =   180
         Left            =   240
         TabIndex        =   6
         Top             =   360
         Width           =   540
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "密 码"
         Height          =   180
         Left            =   240
         TabIndex        =   5
         Top             =   840
         Width           =   540
      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 (NameKey)
'关闭自己
  Unload Me
End Sub

⌨️ 快捷键说明

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