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

📄 frmlogin.frm

📁 VB编写的退税管理系统
💻 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    =   2025
   ClientLeft      =   5760
   ClientTop       =   4140
   ClientWidth     =   4200
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1196.436
   ScaleMode       =   0  'User
   ScaleWidth      =   3943.573
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   8
      Top             =   1440
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   5
      Top             =   1440
      Visible         =   0   'False
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      DataField       =   "用户口令"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   1560
      TabIndex        =   4
      Text            =   "Text2"
      Top             =   1560
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.TextBox Text1 
      DataField       =   "用户名"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   240
      TabIndex        =   3
      Text            =   "Text1"
      Top             =   1560
      Visible         =   0   'False
      Width           =   975
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   2880
      Top             =   1560
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _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=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=zlgl.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=zlgl.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      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 txtUserName 
      Height          =   345
      Left            =   1320
      TabIndex        =   0
      Top             =   240
      Width           =   2325
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "退出"
      Height          =   390
      Left            =   2400
      TabIndex        =   2
      Top             =   1440
      Width           =   1140
   End
   Begin VB.TextBox txtPassword 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   1320
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   720
      Width           =   2325
   End
   Begin VB.Label Label3 
      Caption         =   "毕业设计"
      ForeColor       =   &H000040C0&
      Height          =   255
      Left            =   1800
      TabIndex        =   9
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   7
      Top             =   720
      Width           =   495
   End
   Begin VB.Label Label1 
      Caption         =   "用户名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   6
      Top             =   360
      Width           =   735
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim LoadedSkin As Integer
Dim DisableLayeredWindows As Boolean
Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()
    '设置全局变量为 false
    '不提示失败的登录
    LoginSucceeded = False
    Me.Hide
    Unload Me
    End
End Sub

Private Sub cmdOK_Click()
    '检查正确的密码
    If txtPassword.Text = Text2.Text And txtUserName = Text1.Text Then
        '将代码放在这里传递
        '成功到 calling 函数
        '设置全局变量时最容易的
        LoginSucceeded = True
        Me.Hide
        Load Form1
        Form1.Show
    Else
        MsgBox "无效的密码,请重试!", , "登录"
        txtUserName = ""
        txtPassword = ""
        txtUserName.SetFocus
        SendKeys "{Home}+{End}"
    End If
End Sub

Private Sub Command1_Click()
Unload frmLogin
Form7.Show
End Sub

Private Sub Command2_Click()
Dim i As Boolean
 '检查正确的密码
 i = False
   Adodc1.Recordset.MoveFirst  '将指针移到第一个,否则会出现这样的问题,就是当输入几个错误的用户名和密码后,再输入正确的也进不了系统,这是因为输入错误的后指针已经移到记录的最后了,再输入正确密码时,没有从第一个记录开始找,所以会找不到密码出错
   Do While Not Adodc1.Recordset.EOF
       If txtPassword.Text = Text2.Text And txtUserName = Text1.Text Then
        '将代码放在这里传递
        '成功到 calling 函数
        '设置全局变量时最容易的
         LoginSucceeded = True
        Me.Hide
        Load Form1
        Form1.Show
        Exit Do   '跳出循环
      End If
     
    Adodc1.Recordset.MoveNext
    Loop
If Not LoginSucceeded Then
MsgBox "无效的用户名或密码,请重新输入!", , "登录"
txtPassword.Text = ""
txtUserName = ""
End If
End Sub

⌨️ 快捷键说明

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