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

📄 frmlogin.frm

📁 财务管理信息系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登录"
   ClientHeight    =   2040
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   4050
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1205.299
   ScaleMode       =   0  'User
   ScaleWidth      =   3802.731
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   3360
      TabIndex        =   6
      Text            =   "Text3"
      Top             =   1200
      Visible         =   0   'False
      Width           =   375
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   240
      Top             =   1680
      Visible         =   0   'False
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=ais"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "ais"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "用户表"
      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.TextBox text1 
      Height          =   345
      Left            =   1290
      TabIndex        =   1
      Top             =   240
      Width           =   2325
   End
   Begin VB.CommandButton command1 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   390
      Left            =   720
      TabIndex        =   4
      Top             =   1320
      Width           =   1140
   End
   Begin VB.CommandButton command2 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   390
      Left            =   2040
      TabIndex        =   5
      Top             =   1320
      Width           =   1140
   End
   Begin VB.TextBox text2 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   1290
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   720
      Width           =   2325
   End
   Begin VB.Label label1 
      Caption         =   "用户名称(&U):"
      Height          =   270
      Index           =   0
      Left            =   105
      TabIndex        =   0
      Top             =   360
      Width           =   1080
   End
   Begin VB.Label label2 
      Caption         =   "密码(&P):"
      Height          =   270
      Index           =   1
      Left            =   105
      TabIndex        =   2
      Top             =   840
      Width           =   1080
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim appuser As String
Dim appassw As String
Dim entertime As Integer

Private Sub Command1_Click()
    Call confirm
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub form_load()
    entertime = 0
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Call confirm
    End If
End Sub

Sub confirm()
    entertime = entertime + 1
    If entertime > 3 Then
        MsgBox "输入次数大于3次,系统自动退出……"
        Unload Me
    Else
        appuser = Text1.Text
        Adodc1.Recordset.Find "name='" + appuser + "'"
        If Adodc1.Recordset.EOF Then '没有找到该用户
            MsgBox "用户名或密码错误,请重新输入……"
            Text1.Text = ""
        Else '用户名正确,核对密码
            If Adodc1.Recordset.Fields("password") = Text2.Text Then
                main.Show
                Unload Me
            Else
                MsgBox "密码错误,请重新输入……"
                Text2.Text = ""
            End If
        End If
    End If
End Sub

⌨️ 快捷键说明

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