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

📄 frmchangepwd.frm

📁 基于vbasic开发
💻 FRM
字号:
VERSION 5.00
Object = "{8ED8CCC1-8472-46D0-93E7-F66929B98442}#2.0#0"; "XPCMD.OCX"
Begin VB.Form frmChangePwd 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "用户密码修改"
   ClientHeight    =   3840
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4680
   Icon            =   "frmChangePwd.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3840
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin XPCmd.xpcmdbutton cmdCancel 
      Height          =   345
      Left            =   2280
      TabIndex        =   10
      Top             =   3240
      Width           =   1095
      _ExtentX        =   1931
      _ExtentY        =   609
      Caption         =   "   取  消"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin XPCmd.xpcmdbutton cmdOk 
      Height          =   345
      Left            =   960
      TabIndex        =   9
      Top             =   3240
      Width           =   1095
      _ExtentX        =   1931
      _ExtentY        =   609
      Caption         =   "   确  认"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Frame Frame1 
      Caption         =   "密码修改"
      Height          =   2415
      Left            =   240
      TabIndex        =   0
      Top             =   600
      Width           =   4095
      Begin VB.TextBox yngc_txtConfirmPwd 
         Appearance      =   0  'Flat
         Height          =   350
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   8
         Top             =   1600
         Width           =   1815
      End
      Begin VB.TextBox yngc_txtUserPwd 
         Appearance      =   0  'Flat
         Height          =   350
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   6
         Top             =   1000
         Width           =   1815
      End
      Begin VB.TextBox yngc_txtFirstPwd 
         Appearance      =   0  'Flat
         Height          =   350
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   380
         Width           =   1815
      End
      Begin VB.Label Label3 
         Caption         =   "    确认密码:"
         Height          =   255
         Index           =   2
         Left            =   600
         TabIndex        =   7
         Top             =   1680
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "输入新密码:"
         Height          =   255
         Index           =   1
         Left            =   600
         TabIndex        =   5
         Top             =   1080
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "输入旧密码:"
         Height          =   255
         Index           =   0
         Left            =   600
         TabIndex        =   3
         Top             =   480
         Width           =   1095
      End
   End
   Begin VB.Label lblUser 
      Height          =   255
      Left            =   1680
      TabIndex        =   2
      Top             =   240
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "当前登录用户:"
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   240
      Width           =   1335
   End
End
Attribute VB_Name = "frmChangePwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private strUserName As String

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOk_Click()

On Error GoTo errHandle:

   Dim strUserPwd As String
   Dim strSql As String
   
   strUserPwd = Trim(yngc_txtUserPwd.Text)
   
   '***********************************************************
   '判断用户输入口令是否与原有口令相同
   strSql = "select user_password from yngc_sys_userlist where user_id='" & strUserName & "'"
   
   '建立OraDynaset对象
   Set objOraDyn = g_clsConnect.ObjectOraDb.CreateDynaset(strSql, 0&)
  '开始一个事务
   g_clsConnect.ObjectOraDb.BeginTrans
   
   '改动(金宝轩)
   If MD5(yngc_txtFirstPwd.Text) <> objOraDyn.Fields("USER_PASSWORD").Value Then 'Decipher
      
      MsgBox "原密码输入错误,请重新输入!", vbInformation, "警告"
      g_clsConnect.ObjectOraDb.CommitTrans
      
      Exit Sub
      
   End If
    g_clsConnect.ObjectOraDb.CommitTrans
   '***********************************************************
   
    If yngc_txtUserPwd.Text = "" Then
      MsgBox "请输入密码!", vbInformation, "提示"
      'strUserPwd = g_clsConnect.Cipher("1")
      Exit Sub
   End If
   
   '***********************************************************
   '更新用户口令
   strUserPwd = MD5(Trim(yngc_txtUserPwd.Text))
   strSql = "update yngc_sys_userlist set user_password='" & strUserPwd & "' where user_id='" & strUserName & "'"
   If yngc_txtUserPwd.Text = yngc_txtConfirmPwd.Text Then
      objResponse = MsgBox("确定修改口令!", vbYesNo + vbInformation, "提示")
      If objResponse = vbYes Then
         g_clsConnect.ObjectOraDb.ExecuteSQL (strSql)
         g_clsConnect.ObjectOraDb.CommitTrans
          '记录用户的操作
         Call g_clsConnect.yngc_subUpdateUserOperation(g_clsConnect.ObjectOraDb, "修改用户" & strUserName & "口令")
         
      End If
   Else
      MsgBox "密码输入不同,请重新输入!", vbInformation, "警告"
      Exit Sub
   End If
   
   MsgBox "密码修改成功!", vbInformation, "信息"
   
   Exit Sub
   
errHandle:
      
      MsgBox "密码修改不成功!", vbInformation, "警告"
      Err.Clear
        
End Sub

Private Sub Form_Load()
    Me.lblUser = g_clsConnect.GetLogUserId
    strUserName = Me.lblUser.Caption
End Sub

⌨️ 快捷键说明

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