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

📄 frmadminsecurity.frm

📁 一个国外的宾馆管理程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAdminSecurity 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "System Security"
   ClientHeight    =   1935
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4695
   Icon            =   "frmAdminSecurity.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1935
   ScaleWidth      =   4695
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame1 
      Height          =   1815
      Left            =   120
      TabIndex        =   4
      Top             =   0
      Width           =   4455
      Begin VB.Data Data1 
         Caption         =   "Data1"
         Connect         =   "Access"
         DatabaseName    =   ""
         DefaultCursorType=   0  'DefaultCursor
         DefaultType     =   2  'UseODBC
         EOFAction       =   2  'Add New
         Exclusive       =   0   'False
         Height          =   345
         Left            =   240
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   0  'Table
         RecordSource    =   ""
         Top             =   1200
         Visible         =   0   'False
         Width           =   1140
      End
      Begin VB.CommandButton Command1 
         Appearance      =   0  'Flat
         Caption         =   "&OK"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   420
         Left            =   1560
         TabIndex        =   2
         Top             =   1200
         Width           =   1215
      End
      Begin VB.CommandButton Command2 
         Appearance      =   0  'Flat
         Caption         =   "&Cancel"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   420
         Left            =   2880
         TabIndex        =   3
         Top             =   1200
         Width           =   1215
      End
      Begin VB.TextBox txtPassword 
         BackColor       =   &H00FFFFFF&
         Height          =   285
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   720
         Width           =   2580
      End
      Begin VB.TextBox txtUsername 
         BackColor       =   &H00FFFFFF&
         Height          =   285
         Left            =   1560
         TabIndex        =   0
         Top             =   360
         Width           =   2580
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Password"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   240
         TabIndex        =   6
         Top             =   720
         Width           =   810
      End
      Begin VB.Label Label14 
         AutoSize        =   -1  'True
         Caption         =   "Username"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   240
         TabIndex        =   5
         Top             =   360
         Width           =   870
      End
   End
End
Attribute VB_Name = "frmAdminSecurity"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Command1_Click()
If txtUsername = "admin" And txtPassword = "admin" Then
    i = 0
    Unload Me
    frmAdministrator.Show 1
Else
    If txtUsername = "" Or txtPassword = "" Then
        MsgBox "Please fill in the boxes!", vbCritical, "Security Error"
        txtUsername.SetFocus
        Exit Sub
    Else
        With Data1.Recordset
            .Index = "seeker"
            .Seek "=", txtUsername
        End With
        If Data1.Recordset.NoMatch = False Then
            With Data1.Recordset
                pass = .Fields("Password")
            End With
            If txtPassword = pass Then
                i = 0
                Unload Me
                frmAdministrator.Show 1
            Else
                If MsgBox("Invalid password!", vbCritical + vbRetryCancel, "Access Denied") = vbRetry Then
                    txtPassword = ""
                    txtPassword.SetFocus
                    Exit Sub
                Else
                    i = 0
                    Unload Me
                End If
            End If
        Else
            If MsgBox("Invalid username!", vbCritical + vbRetryCancel, "Access Denied") = vbRetry Then
                txtUsername = ""
                txtUsername.SetFocus
                Exit Sub
            Else
                i = 0
                Unload Me
            End If
        End If
    End If
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
i = 1
Data1.DatabaseName = App.Path + "\" + "Admins.mdb"
Data1.RecordSource = "Existing"
End Sub

Private Sub Form_Unload(Cancel As Integer)
'Set fromadminsecurity = Nothing
Cancel = i
End Sub

Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Command1_Click
If KeyCode = 27 Then Unload Me
End Sub
Private Sub txtUsername_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then Unload Me
End Sub

⌨️ 快捷键说明

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