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

📄 frmeditpassword.frm

📁 vb编写的图书借阅管理系统开发案例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmEditPassword 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "修改密码"
   ClientHeight    =   1830
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   4410
   Icon            =   "frmEditPassword.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1830
   ScaleWidth      =   4410
   ShowInTaskbar   =   0   'False
   WhatsThisButton =   -1  'True
   WhatsThisHelp   =   -1  'True
   Begin VB.TextBox txtNewPassword 
      Enabled         =   0   'False
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   960
      MaxLength       =   10
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   855
      Width           =   3330
   End
   Begin VB.TextBox txtOldPassword 
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   960
      MaxLength       =   10
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   480
      Width           =   3330
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   360
      Left            =   2940
      TabIndex        =   3
      Top             =   1350
      Width           =   1215
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   360
      Left            =   1605
      TabIndex        =   2
      Top             =   1350
      Width           =   1215
   End
   Begin VB.Label lblAccreditID 
      BorderStyle     =   1  'Fixed Single
      Height          =   300
      Left            =   960
      TabIndex        =   7
      Top             =   90
      Width           =   3330
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "管理员ID:"
      Height          =   180
      Index           =   2
      Left            =   165
      TabIndex        =   6
      Top             =   105
      Width           =   810
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "新密码:"
      Height          =   180
      Index           =   0
      Left            =   165
      TabIndex        =   5
      Top             =   855
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "原密码:"
      Height          =   180
      Index           =   1
      Left            =   165
      TabIndex        =   4
      Top             =   480
      Width           =   630
   End
End
Attribute VB_Name = "frmEditPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
    Unload Me  ' 放弃更新
End Sub

Private Sub cmdOK_Click()
    '更新密码
    mCdt.UpdataPassword lblAccreditID, Trim(txtOldPassword), Trim(txtNewPassword)
    Unload Me
End Sub

Public Function checkPassword(strAccreditID As String, strPassword As String) As Integer
    '身份验证过程
    Dim rs As ADODB.Recordset
    Dim I As Integer
    Set rs = mCdt.rsValidatePassword(strAccreditID, strPassword)
    I = rs(0)
    rs.Close
    checkPassword = I
End Function

Private Sub txtOldPassword_LostFocus()
    '更新密码前调用身份验证过程
    If checkPassword(lblAccreditID, txtOldPassword) = 1 Then
        txtOldPassword.Enabled = False
        txtNewPassword.Enabled = True
        cmdOK.Enabled = True
        txtNewPassword.SetFocus
    Else
        MsgBox "该管理员身份或密码验证无效!", vbInformation
        txtOldPassword.SetFocus
    End If
End Sub

⌨️ 快捷键说明

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