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

📄 frm_登录.frm

📁 计量器具管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frm_logon 
   BackColor       =   &H80000009&
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   2925
   ClientLeft      =   15
   ClientTop       =   15
   ClientWidth     =   4485
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2925
   ScaleWidth      =   4485
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton SmartNetXpButton2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2520
      TabIndex        =   9
      Top             =   2400
      Width           =   1095
   End
   Begin VB.CommandButton SmartNetXpButton1 
      Caption         =   "确定"
      Height          =   375
      Left            =   720
      TabIndex        =   8
      Top             =   2400
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Align           =   1  'Align Top
      BackColor       =   &H00FFC0C0&
      ClipControls    =   0   'False
      Height          =   2295
      Left            =   0
      ScaleHeight     =   2235
      ScaleWidth      =   4425
      TabIndex        =   1
      Top             =   0
      Width           =   4485
      Begin VB.TextBox Txtmc 
         Height          =   345
         IMEMode         =   3  'DISABLE
         Left            =   1590
         TabIndex        =   6
         Top             =   1650
         Width           =   2235
      End
      Begin VB.TextBox txtKl 
         Height          =   345
         IMEMode         =   3  'DISABLE
         Left            =   1590
         PasswordChar    =   "*"
         TabIndex        =   5
         Top             =   1230
         Width           =   2235
      End
      Begin VB.TextBox txtYhbh 
         Height          =   345
         Left            =   1590
         TabIndex        =   0
         Top             =   810
         Width           =   2235
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "用户名称:"
         Height          =   285
         Left            =   600
         TabIndex        =   7
         Top             =   1740
         Width           =   1065
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "用户口令:"
         Height          =   285
         Left            =   600
         TabIndex        =   4
         Top             =   1320
         Width           =   1065
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "用户编号:"
         Height          =   285
         Left            =   600
         TabIndex        =   3
         Top             =   900
         Width           =   1065
      End
      Begin VB.Shape Shape1 
         BorderColor     =   &H00404040&
         Height          =   1545
         Left            =   390
         Top             =   630
         Width           =   3615
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "计量器具管理系统登录"
         BeginProperty Font 
            Name            =   "华文行楷"
            Size            =   18
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   375
         Left            =   420
         TabIndex        =   2
         Top             =   150
         Width           =   3615
      End
   End
End
Attribute VB_Name = "frm_logon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) * (1 - 0.618)
End Sub

Private Sub SmartNetXpButton1_Click()
    If txtYhbh.Text <> "" And txtKl.Text <> "" Then
        Dim sys As New ADODB.Recordset
        sys.CursorLocation = adUseClient
        If sys.State = 1 Then sys.Close
        sys.Open "select * from users where bh='" + Trim(txtYhbh.Text) + "' and kl='" & Trim(txtKl.Text) & "'", Conn
        If sys.EOF = True Then
            MsgBox "密码不正确!", vbCritical, "系统登录"
            txtKl.SetFocus
            txtKl.Text = ""
            Exit Sub
        Else
            Czybh = sys!Bh
            Czymc = sys!Mc
            Unload Me
            log = True
            Exit Sub
        End If
    End If
End Sub

Private Sub SmartNetXpButton2_Click()
    Unload MainForm
    End
End Sub

Private Sub txtKl_GotFocus()
    If Trim(txtYhbh.Text) = "" Then txtYhbh.SetFocus
End Sub

Private Sub txtKl_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   Call SmartNetXpButton1_Click
   Exit Sub
End If
End Sub


Private Sub txtYhbh_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If Trim(txtYhbh.Text) <> "" Then
            Dim rst As New ADODB.Recordset
            If rst.State = 1 Then rst.Close
            rst.CursorLocation = adUseClient
            rst.Open "select * from users where bh='" & Trim(txtYhbh.Text) & "'", Conn, adOpenStatic, adLockReadOnly
            If rst.EOF = False Then
                Txtmc.Text = rst!Mc
                txtKl.SetFocus
            Else
                MsgBox "无此用户编号,请与系统管理员联系!", vbCritical, "系统登录"
                Txtmc.Text = ""
                txtYhbh.Text = ""
            End If
        End If
    End If
End Sub

⌨️ 快捷键说明

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