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

📄 frmlogin.frm

📁 给人写的毕设
💻 FRM
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登录"
   ClientHeight    =   1455
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   3735
   Icon            =   "frmLogin.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   859.662
   ScaleMode       =   0  'User
   ScaleWidth      =   3506.963
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   120
      Top             =   1200
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   582
      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=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=dangan"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "dangan"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "SELECT * FROM 用户"
      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 MSDataListLib.DataCombo DataCombo1 
      Bindings        =   "frmLogin.frx":0442
      DataField       =   "用户"
      DataMember      =   "用户名"
      DataSource      =   "DataEnvironment1"
      Height          =   330
      Left            =   1200
      TabIndex        =   5
      Top             =   120
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   582
      _Version        =   393216
      Style           =   2
      ListField       =   "用户"
      Text            =   ""
      Object.DataMember      =   "用户名"
   End
   Begin VB.CommandButton cmdOK 
      BackColor       =   &H00FFFFC0&
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   390
      Left            =   1019
      TabIndex        =   0
      Top             =   960
      Width           =   1140
   End
   Begin VB.CommandButton cmdCancel 
      BackColor       =   &H00FFFFC0&
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   390
      Left            =   2520
      MaskColor       =   &H00FFFFC0&
      TabIndex        =   4
      Top             =   960
      UseMaskColor    =   -1  'True
      Width           =   1140
   End
   Begin VB.TextBox txtPassword 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   1200
      MaxLength       =   10
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   525
      Width           =   2415
   End
   Begin VB.Image Image1 
      Height          =   330
      Left            =   298
      Picture         =   "frmLogin.frx":047C
      Top             =   999
      Width           =   360
   End
   Begin VB.Label lblLabels 
      Caption         =   "用户名称(&U):"
      Height          =   270
      Index           =   0
      Left            =   105
      TabIndex        =   1
      Top             =   150
      Width           =   1080
   End
   Begin VB.Label lblLabels 
      Alignment       =   2  'Center
      Caption         =   "密码(&P):"
      Height          =   270
      Index           =   1
      Left            =   105
      TabIndex        =   2
      Top             =   585
      Width           =   1080
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''
' 该窗体是启动窗体,并检验用户
'''''''''''''''''''''''''''

Option Explicit



Private Sub cmdCancel_Click()
    
    Unload Me
   End
End Sub

Private Sub cmdOK_Click()
Dim yonghu As String
Dim mima, mima2 As String
Dim weizhi As Integer
Dim n As Integer
n = 1
    yonghu = Me.DataCombo1.Text           '
    mima = Me.txtPassword.Text            '
    
    weizhi = Me.DataCombo1.SelectedItem   '确定所选择的记录
    Adodc1.Refresh                        '
    Adodc1.Recordset.MoveFirst            '
Do Until n = weizhi                       '
Me.Adodc1.Recordset.MoveNext              '
n = n + 1                                 '
Loop                                      '定位记录到所选择的“用户名”
jibie = Adodc1.Recordset("级别")          '设置全局变量“级别”,用在区分不同用户的功能级别。
If IsNull(Adodc1.Recordset("密码")) Then  '
mima2 = ""                                '
Else                                      '
mima2 = Adodc1.Recordset("密码")          '
End If                                    '
If mima = mima2 Then                      '
    Formmain.Show                         '
    Me.Hide                               '
Else                                        '
    MsgBox "无效的密码,请重试!", , "登录"  '
End If                                      '
                                            '
                                            '检查正确的密码
                                            '
End Sub

⌨️ 快捷键说明

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