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

📄 frm_login.frm

📁 家庭或个人最好的管理小型软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frm_login 
   Appearance      =   0  'Flat
   BorderStyle     =   1  'Fixed Single
   Caption         =   "登陆"
   ClientHeight    =   2670
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4605
   Icon            =   "frm_login.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2670
   ScaleWidth      =   4605
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2640
      TabIndex        =   5
      Top             =   2160
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   960
      TabIndex        =   4
      Top             =   2160
      Width           =   975
   End
   Begin VB.TextBox txt_password 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1440
      Width           =   1695
   End
   Begin VB.TextBox txt_name 
      Height          =   375
      Left            =   1560
      TabIndex        =   0
      Top             =   840
      Width           =   1695
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "家庭理财管理系统"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   360
      TabIndex        =   6
      Top             =   120
      Width           =   4335
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "密码:"
      Height          =   255
      Left            =   480
      TabIndex        =   3
      Top             =   1560
      Width           =   615
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "用户名:"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   960
      Width           =   735
   End
End
Attribute VB_Name = "frm_login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mydb As New ADODB.Recordset
Dim Mydb1 As New ADODB.Recordset
Dim Str_text As String
Private Sub Command1_Click()
    On Error Resume Next
    Static I As Integer '记数器
    Static L As Integer '记数器
    Dim Str_name As String
    Dim Str_password As String
    Dim Str_username As String
    Dim Str_userpassword As String
    Dim Remainday As Long
    Str_name = txt_name.Text
    Str_password = txt_password.Text

    Set Mydb = ExeCutesql("select user from user1 where user='" & Str_name & "'", Str_text)

    If Mydb.EOF Then
        MsgBox "你输入的用户名不存在,请重新输入!", vbOKOnly + 32, "注意"
        L = L + 1
        txt_name.SetFocus
        If L = 5 Then
            MsgBox "你已经多次输入错误的用户名,请查证后重新登陆!", vbOKOnly + 48, "注意"
            End
        End If
        Exit Sub
    Else
        Set Mydb1 = ExeCutesql("select user,pass from user1 where user='" & Str_name & "'", Str_text)
        Str_username = Trim(Mydb1.Fields(0))
        Str_userpassword = Trim(Mydb1.Fields(1))
        If Trim(Str_password) = Str_userpassword Then

            frm_main.Show
            Mydb.Close
            Mydb1.Close
            Set Mydb = Nothing
            Set Mydb1 = Nothing
            Unload Me
        Else
            MsgBox "你输入的密码错误,请重新输入!", vbOKOnly + 32, "注意"
            I = I + 1
            txt_password.SetFocus
            If I = 3 Then
                MsgBox "你输入的密码三次都不正确,本系统将关闭!", vbOKOnly + 48, "注意"
                End
            End If
            Exit Sub
        End If
    End If

End Sub
Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub txt_name_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then txt_password.SetFocus

End Sub

Private Sub txt_password_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Command1.SetFocus
End Sub

Private Sub txt_name_LostFocus()
    Cname = txt_name.Text
End Sub

⌨️ 快捷键说明

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