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

📄 login.frm

📁 图书管理系统源码+论文+程序+PPT
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Login 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   3855
   ClientLeft      =   4785
   ClientTop       =   4290
   ClientWidth     =   6105
   Icon            =   "Login.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3855
   ScaleWidth      =   6105
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame1 
      Height          =   3735
      Left            =   120
      TabIndex        =   4
      Top             =   0
      Width           =   5895
      Begin VB.CommandButton cmdOK 
         Caption         =   "确定(&O)"
         Default         =   -1  'True
         Enabled         =   0   'False
         Height          =   615
         Left            =   840
         TabIndex        =   2
         Top             =   2040
         Width           =   1215
      End
      Begin VB.CommandButton cmdCancel 
         Cancel          =   -1  'True
         Caption         =   "取消(&C)"
         Height          =   615
         Left            =   3120
         TabIndex        =   3
         Top             =   2040
         Width           =   1215
      End
      Begin VB.TextBox Txt_User 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   3000
         Locked          =   -1  'True
         TabIndex        =   9
         TabStop         =   0   'False
         Top             =   653
         Width           =   2055
      End
      Begin MSComCtl2.DTPicker DTPicker1 
         Height          =   375
         Left            =   720
         TabIndex        =   8
         TabStop         =   0   'False
         Top             =   3000
         Visible         =   0   'False
         Width           =   2055
         _ExtentX        =   3625
         _ExtentY        =   661
         _Version        =   393216
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         CalendarBackColor=   16744576
         CalendarTitleBackColor=   16761024
         CalendarTitleForeColor=   255
         Format          =   25427968
         CurrentDate     =   38093
      End
      Begin VB.TextBox txtTime 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFFF&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   3240
         Locked          =   -1  'True
         TabIndex        =   7
         TabStop         =   0   'False
         Top             =   3000
         Width           =   2055
      End
      Begin VB.Timer Timer1 
         Interval        =   100
         Left            =   120
         Top             =   3240
      End
      Begin VB.TextBox txtPassword 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         IMEMode         =   3  'DISABLE
         Left            =   3000
         MaxLength       =   12
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   1275
         Width           =   2055
      End
      Begin VB.ComboBox Combo1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         ItemData        =   "Login.frx":0CCA
         Left            =   3000
         List            =   "Login.frx":0CCC
         Style           =   2  'Dropdown List
         TabIndex        =   0
         Top             =   660
         Width           =   2055
      End
      Begin VB.TextBox txtDate 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFFF&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   720
         Locked          =   -1  'True
         TabIndex        =   10
         TabStop         =   0   'False
         Top             =   3000
         Width           =   2055
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "密 码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   1
         Left            =   1920
         TabIndex        =   6
         Top             =   1320
         Width           =   840
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "用  户:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   1920
         TabIndex        =   5
         Top             =   720
         Width           =   840
      End
      Begin VB.Image Image1 
         Height          =   720
         Left            =   720
         Picture         =   "Login.frx":0CCE
         Top             =   720
         Width           =   720
      End
   End
End
Attribute VB_Name = "Login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim adoCon As ADODB.Connection
Dim adoRst As ADODB.Recordset   '用于连接ACCESSOperater 表
Dim ConPath As String
Dim SQL As String
Dim TbName As String            '用于存 Operater  表名
Private Sub cmdCancel_Click()         '取消
      End
End Sub
Private Sub CmdOK_Click()             '登录
  adoRst.Fields("姓名") = Txt_User.Text
  adoRst.Update
  If txtPassword.Text = Password And Trim(Password) <> "" Then
      Load Frmmain
      Frmmain.Show
      Me.Hide
  Else

    MsgBox "输入的密码有误,请重新输入!!", vbInformation + vbOKOnly, "系统提示"
    txtPassword.SetFocus
  End If
  txtPassword = ""
End Sub
Private Sub cmdUser_Click()
  Txt_User.Locked = False
  Txt_User.SetFocus
  Txt_User.BackColor = &HC0FFFF
End Sub
Private Sub Form_Activate()
   
    If adoCon.State = adStateOpen Then
        adoCon.Close
    End If
    adoCon.ConnectionString = ConPath
    adoCon.Open
      
    SQL = "select * from " & TbName & ""
    If adoRst.State = adStateOpen Then
        adoRst.Close
    End If
    adoRst.ActiveConnection = adoCon
    adoRst.Source = SQL
    adoRst.CursorLocation = adUseClient
    adoRst.CursorType = adOpenKeyset
    adoRst.LockType = adLockOptimistic
    adoRst.Open
    
    If adoRst.RecordCount > 0 Then
       adoRst.MoveFirst
       Password = adoRst.Fields("密码")
       Txt_User.Text = adoRst.Fields("姓名")
    Else
        MsgBox "数据库遭到破坏,请联系软件技术人员!!", vbInformation + vbOKOnly, "系统提示"
        End
    End If
    
    Login.Caption = "登录"
    txtDate = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日"
    DTPicker1.Value = Date
    cmdOK.Enabled = False
    txtPassword.SetFocus

End Sub
Private Sub Form_Load()  '初始化
    Set adoCon = New ADODB.Connection
    Set adoRst = New ADODB.Recordset
    ConPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\校园图书管理系统.mdb;Persist Security Info=False"

    TbName = "Operater"
End Sub
Private Sub Timer1_Timer()
  txtTime.Text = Time
End Sub
Private Sub txtPassword_Change()      '判断是否输入密码
  If Len(Trim(txtPassword)) = 0 Then
    cmdOK.Enabled = False
  Else
    cmdOK.Enabled = True
  End If
End Sub
Private Sub txtPassword_GotFocus()
  txtPassword.BackColor = &HC0FFFF
  txtPassword.SelStart = 0
  txtPassword.SelLength = 12
End Sub
Private Sub txtPassword_LostFocus()
  txtPassword.BackColor = &HFFC0C0
End Sub


⌨️ 快捷键说明

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