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

📄 form2.frm

📁 VB编写的企业管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   Caption         =   "登陆"
   ClientHeight    =   4545
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5265
   Icon            =   "Form2.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "Form2.frx":030A
   ScaleHeight     =   4545
   ScaleWidth      =   5265
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   150
      Left            =   4560
      Top             =   3120
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2520
      TabIndex        =   6
      Top             =   3360
      Width           =   1455
   End
   Begin VB.CommandButton cmdOK 
      BackColor       =   &H00000080&
      Caption         =   "确定"
      DisabledPicture =   "Form2.frx":76FC
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   480
      Picture         =   "Form2.frx":7CE5
      TabIndex        =   5
      Top             =   3360
      Width           =   1455
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "Form2.frx":10106
      Left            =   1920
      List            =   "Form2.frx":10110
      TabIndex        =   2
      Top             =   2520
      Width           =   1815
   End
   Begin VB.TextBox Password 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1920
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1800
      Width           =   1815
   End
   Begin VB.TextBox UserName 
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   1920
      TabIndex        =   0
      Top             =   960
      Width           =   1815
   End
   Begin VB.Label Label4 
      BackColor       =   &H0080FF80&
      BackStyle       =   0  'Transparent
      Caption         =   "欢迎使用企业人事管理系统"
      BeginProperty Font 
         Name            =   "华文彩云"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF00FF&
      Height          =   495
      Left            =   360
      TabIndex        =   8
      Top             =   120
      Width           =   4575
   End
   Begin VB.Label Label3 
      BackColor       =   &H00FFC0C0&
      BackStyle       =   0  'Transparent
      Caption         =   "权限:"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   7
      Top             =   2520
      Width           =   1335
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFC0C0&
      BackStyle       =   0  'Transparent
      Caption         =   "密码:"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   1800
      Width           =   1215
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FFC0C0&
      BackStyle       =   0  'Transparent
      Caption         =   "用户名:"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   3
      Top             =   960
      Width           =   1335
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim pwdCount As Integer

Private Sub cmdCancel_Click()
    Unload Me
    Exit Sub
End Sub
Private Sub cmdOK_Click()
Dim sql As String
Dim rs As ADODB.Recordset

If Trim(UserName.Text = "") Then
        MsgBox "没有输入用户名称,请重新输入!", vbOKOnly + vbExclamation, "警告"
        UserName.SetFocus
Else                                                '查询用户
        sql = "select * from UserInfo where UserID='" & UserName.Text & "'"
        Set rs = TransactSQL(sql)
        If iflag = 1 Then
            If rs.EOF = True Then
                MsgBox "没有这个用户,请重新输入!", vbOKOnly + vbExclamation, "警告"
                UserName.SetFocus
            Else
                If Trim(rs.Fields(1)) = Trim(Password.Text) Then
                  ' If Combo1.Text = "" Then
                    ' MsgBox "请选择权限"
                    ' Combo1.SetFocus
                   'Else
                     rs.Close
                     Me.Hide
                    qx = Trim(Combo1.Text)
                    gUserName = Trim(UserName.Text)         '保存用户名称
                    Form3.Show
                    Unload Me
                 Else
                    MsgBox "密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
                    Password.SetFocus
                    Password.Text = ""
                  'End If
                End If
            End If
        Else
            Unload Me
        End If
    End If
    pwdCount = pwdCount + 1                             '判断输入次数
    If pwdCount = 3 Then
        Unload Me
        Exit Sub
    End If
End Sub



Private Sub Form_Load()
    pwdCount = 0
    gUserName = ""
End Sub

Private Sub PassWord_KeyDown(KeyCode As Integer, Shift As Integer)
    TabToEnter KeyCode
End Sub

Private Sub Password_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdOK.SetFocus
End If
End Sub

Private Sub Timer1_Timer()
If Form2.Label4.Left > 0 Then
Form2.Label4.Left = Form2.Label4.Left - 200
Else
Form2.Label4.Left = Form2.ScaleWidth
End If
End Sub

Private Sub UserName_KeyDown(KeyCode As Integer, Shift As Integer)
    TabToEnter KeyCode
End Sub

⌨️ 快捷键说明

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