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

📄 frmuseredit.frm

📁 业务管理系统。方便业务员跟踪记录客户信息。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmLogin 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "登录"
   ClientHeight    =   2625
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5595
   Icon            =   "FrmLogin.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   2625
   ScaleWidth      =   5595
   Begin VB.Frame Fram 
      Height          =   2715
      Left            =   0
      TabIndex        =   0
      Top             =   -90
      Width           =   5595
      Begin VB.Timer TimerStart 
         Interval        =   200
         Left            =   2655
         Top             =   2205
      End
      Begin VB.TextBox TxtPwd 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Left            =   1800
         PasswordChar    =   "*"
         TabIndex        =   6
         Top             =   1005
         Width           =   2445
      End
      Begin VB.TextBox TxtUser 
         Height          =   330
         Left            =   1800
         TabIndex        =   5
         Top             =   585
         Width           =   2445
      End
      Begin VB.CommandButton CommRewrite 
         Caption         =   "重写"
         Height          =   375
         Left            =   3465
         TabIndex        =   4
         Top             =   1935
         Width           =   1635
      End
      Begin VB.CommandButton CommOk 
         Caption         =   "确定"
         Height          =   375
         Left            =   585
         TabIndex        =   3
         Top             =   1935
         Width           =   1635
      End
      Begin VB.Line LBlack 
         BorderColor     =   &H00808080&
         X1              =   135
         X2              =   5460
         Y1              =   1705
         Y2              =   1705
      End
      Begin VB.Line LWhite 
         BorderColor     =   &H00FFFFFF&
         X1              =   135
         X2              =   5460
         Y1              =   1700
         Y2              =   1700
      End
      Begin VB.Label LabPwd 
         Caption         =   "密码"
         Height          =   180
         Left            =   1260
         TabIndex        =   2
         Top             =   1080
         Width           =   360
      End
      Begin VB.Label LabUser 
         Caption         =   "用户"
         Height          =   180
         Left            =   1260
         TabIndex        =   1
         Top             =   660
         Width           =   360
      End
   End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub CommOk_Click()

    If TxtUser.Text = "" Then
        MsgBox "    请填写用户名!    ", , "用户名错误"
        TxtUser.SetFocus
        Exit Sub
    End If
    If TxtPwd.Text = "" Then
        MsgBox "    请填写密码!    ", , "用户名错误"
        TxtPwd.SetFocus
        Exit Sub
    End If
    
    Dim Rst As New ADODB.Recordset
    
    Set Rst = Conn.Execute("SELECT User,Pwd FROM [User] WHERE User='" & TxtUser.Text & "'")
    
    If Rst.EOF Then
        MsgBox "    用户名不存在!    "
        With TxtUser
            .SelStart = 0
            .SelLength = Len(.Text)
            .SetFocus
        End With
    Else
        With TxtPwd
            If Rst("Pwd").Value = .Text Then
                SaveSetting "Operation", "Login", "User", TxtUser.Text
                If Me.WindowState <> 1 Then
                    SaveSetting "Operation", "Login", "Left", Me.Left
                    SaveSetting "Operation", "Login", "Top", Me.Top
                End If
                User = .Text
                EButton "01111"
                Unload Me
            Else
                MsgBox "    密码错误!    "
                .SelStart = 0
                .SelLength = Len(.Text)
                .SetFocus
            End If
        End With
    End If
    
End Sub

Private Sub CommRewrite_Click()

    TxtUser.Text = ""
    TxtPwd.Text = ""
    TxtUser.SetFocus
    
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    If KeyCode = 13 Then
        CommOk_Click
    End If
    
End Sub

Private Sub Form_Load()

    EButton "00000"
    
    TxtUser.Text = GetSetting("Operation", "Login", "User", "Admin")
    Me.Left = GetSetting("Operation", "Login", "Left", "3000")
    Me.Top = GetSetting("Operation", "Login", "Top", "2000")
    
End Sub

Private Sub Form_Unload(Cancel As Integer)

    MDIFrm.CommLogin.Enabled = True
    
End Sub

Private Sub TimerStart_Timer()

    TxtPwd.SetFocus
    TimerStart.Enabled = False
    
End Sub

⌨️ 快捷键说明

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