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

📄 passwordform.frm

📁 即时通讯
💻 FRM
字号:
VERSION 5.00
Begin VB.Form passwordform 
   Caption         =   "修改密码"
   ClientHeight    =   3045
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4080
   LinkTopic       =   "Form1"
   ScaleHeight     =   3045
   ScaleWidth      =   4080
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      Height          =   735
      Left            =   0
      TabIndex        =   9
      Top             =   2280
      Width           =   4095
      Begin VB.CommandButton Command2 
         Caption         =   "退出"
         Height          =   375
         Left            =   3000
         TabIndex        =   11
         Top             =   240
         Width           =   855
      End
      Begin VB.CommandButton Command1 
         Caption         =   "修改"
         Default         =   -1  'True
         Height          =   375
         Left            =   1920
         TabIndex        =   10
         Top             =   240
         Width           =   855
      End
   End
   Begin VB.Frame Frame1 
      Height          =   2415
      Left            =   0
      TabIndex        =   0
      Top             =   -120
      Width           =   4095
      Begin VB.TextBox Text4 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1920
         MaxLength       =   40
         PasswordChar    =   "*"
         TabIndex        =   8
         Top             =   1800
         Width           =   1695
      End
      Begin VB.TextBox Text3 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1920
         MaxLength       =   40
         PasswordChar    =   "*"
         TabIndex        =   7
         Top             =   1320
         Width           =   1695
      End
      Begin VB.TextBox Text2 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1920
         MaxLength       =   40
         PasswordChar    =   "*"
         TabIndex        =   6
         Top             =   840
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         Enabled         =   0   'False
         Height          =   300
         Left            =   1920
         MaxLength       =   40
         TabIndex        =   5
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Label4 
         Caption         =   "新密码确认:"
         Height          =   255
         Left            =   600
         TabIndex        =   4
         Top             =   1920
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "新  密  码:"
         Height          =   255
         Left            =   600
         TabIndex        =   3
         Top             =   1440
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "旧  密  码:"
         Height          =   255
         Left            =   600
         TabIndex        =   2
         Top             =   960
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "用  户  名:"
         Height          =   255
         Left            =   600
         TabIndex        =   1
         Top             =   480
         Width           =   1215
      End
   End
End
Attribute VB_Name = "passwordform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'*    模 块 名 称 :应用程序修改密码窗体
'*    功 能 描 述 :应用程序修改密码窗体
'*    程序员姓名  : 石春晓
'*    最后修改人  : 陈齐国
'*    最后修改时间:2005/09/30
'**************************************
Private m_passwordDAO As employeeDAO ' 数据库操作类
Private m_recordset As ADODB.Recordset ' 数据操作数据集对象
Private oldpassword As String          ' 旧密码
Private f As String

Public m_operateType As Integer        ' 操作类型     0 - 修改自己的密码
                                       '              1 - 修改他人的密码
Public m_employeeId As String          ' 要修改密码的用户ID

Private Sub Command1_Click()
Check
If f = 1 Then
    m_passwordDAO.Modifypassword m_recordset, Trim(MainForm.g_application.m_userId), Trim(Text3.text)
    MainForm.g_msgText = "修改成功!"
    HMsgBox MainForm.g_msgText, 0, 1
    Unload Me
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Set m_passwordDAO = New employeeDAO
Set m_recordset = New ADODB.Recordset
SetToCenter Me

m_employeeId = MainForm.g_application.m_userId

m_passwordDAO.FindById m_recordset, Trim(m_employeeId)
With m_recordset
    Text1.text = Trim(.Fields("员工姓名"))
    oldpassword = Trim(.Fields("密码"))
End With
m_recordset.Close
End Sub
Private Sub Check()
    f = "1"
    If Trim(Text2.text) <> oldpassword Then
        MainForm.g_msgText = "旧密码不正确,请重新输入!"
        HMsgBox MainForm.g_msgText, 0, 1
        Text2.SetFocus
        f = "0"
        Exit Sub
        
    End If
    
    If Trim(Text3.text) <> Trim(Text4.text) Then
        MainForm.g_msgText = "新密码与新密码确认不一致,请重新输入!"
        HMsgBox MainForm.g_msgText, 0, 1
        Text3.text = ""
        Text4.text = ""
        Text3.SetFocus
        f = "0"
        Exit Sub
    End If
    If Trim(Text3.text) = "" Then
        MainForm.g_msgText = "新密码不能为空,请重新输入!"
        HMsgBox MainForm.g_msgText, 0, 1
        Text3.SetFocus
        f = "0"
        Exit Sub
    End If
        
End Sub

⌨️ 快捷键说明

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