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

📄 frmeditpwd.frm

📁 电子通迅寻的制作,请大家下载这个哦,一个现成的
💻 FRM
字号:
VERSION 5.00
Object = "{653A556A-745E-476A-BB7C-20AB9DC0A4FB}#5.0#0"; "EXBUTTON.OCX"
Begin VB.Form frmEditPWD 
   Caption         =   "电子通讯录-密码修改"
   ClientHeight    =   3075
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5145
   Icon            =   "frmEditPWD.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   3075
   ScaleWidth      =   5145
   StartUpPosition =   2  '屏幕中心
   Begin EXButton.ExBtn cmdOK 
      Default         =   -1  'True
      Height          =   375
      Left            =   3960
      TabIndex        =   10
      Top             =   1920
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      ForeColor       =   16711680
      CRad            =   3
      Skin            =   "frmEditPWD.frx":0CCA
      Style           =   4
      Caption         =   "确 定"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin EXButton.ExBtn cmdCancel 
      Cancel          =   -1  'True
      Height          =   375
      Left            =   3960
      TabIndex        =   9
      Top             =   2520
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      ForeColor       =   16711680
      CRad            =   3
      Skin            =   "frmEditPWD.frx":236E
      Style           =   4
      Caption         =   "取 消"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00FF80FF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   -1  'True
      EndProperty
      Height          =   375
      Left            =   2520
      ScaleHeight     =   315
      ScaleWidth      =   1035
      TabIndex        =   8
      Top             =   2520
      Width           =   1095
   End
   Begin VB.TextBox txtYZM 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1200
      TabIndex        =   7
      Top             =   2520
      Width           =   1215
   End
   Begin VB.TextBox txtNewPwd2 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1200
      PasswordChar    =   "*"
      TabIndex        =   6
      Top             =   1800
      Width           =   2415
   End
   Begin VB.TextBox txtNewPwd1 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1200
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   1080
      Width           =   2415
   End
   Begin VB.TextBox txtOldPwd 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1200
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   360
      Width           =   2415
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "验证码:"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   240
      TabIndex        =   3
      Top             =   2520
      Width           =   720
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "密码确认:"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   240
      TabIndex        =   2
      Top             =   1800
      Width           =   900
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "新密码:"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   240
      TabIndex        =   1
      Top             =   1080
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "旧密码:"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   720
   End
End
Attribute VB_Name = "frmEditPWD"
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()
Dim mrc As ADODB.Recordset
Dim txtSQL As String

'检验输入数据
If Len(txtOldPwd.Text) = 0 Then
  MsgBox "请输入旧密码!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtOldPwd.SetFocus
  Exit Sub
End If
If Len(txtNewPwd1.Text) = 0 Then
  MsgBox "请输入新密码!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtNewPwd1.SetFocus
  Exit Sub
End If
If Len(txtNewPwd2.Text) = 0 Then
  MsgBox "请确认新密码!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtNewPwd2.SetFocus
  Exit Sub
End If
If Len(txtYZM.Text) = 0 Then
  MsgBox "请输入验证码!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtYZM.SetFocus
  Exit Sub
End If

'判断旧密码是否输入正确
txtSQL = "select * from Tbl_Users where 用户名 = '" & UserName & "'"
Set mrc = ExecuteSQL(txtSQL)
If EncodePassWord(Trim(txtOldPwd.Text)) <> Trim(mrc.Fields(1)) Then
  MsgBox "密码不正确,请重新输入!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtOldPwd.SetFocus
  mrc.Close
  Exit Sub
End If
If Trim(txtNewPwd1.Text) <> Trim(txtNewPwd2.Text) Then
  MsgBox "新密码前后输入不一致,请重新输入!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtNewPwd2.Text = ""
  txtNewPwd2.SetFocus
  Exit Sub
End If
If Trim(txtYZM.Text) <> Picture1.Tag Then
  MsgBox "验证码输入不正确!", vbOKOnly + vbExclamation, "电子通讯录-提示"
  txtYZM.Text = ""
  txtYZM.SetFocus
  Call YZM
  Exit Sub
End If

'若全部检验正确,则保存新密码
mrc.Fields(1) = EncodePassWord(Trim(txtNewPwd2.Text))
mrc.Update
MsgBox "密码修改成功,请记住新密码!", vbOKOnly + vbInformation, "电子通讯录-提示"
mrc.Close
Unload Me
End Sub

Private Sub Form_Activate()
  Call YZM
End Sub

Private Sub YZM()
  Dim i As Integer
  Randomize
  i = Int(Rnd * (9999 - 1000 + 1) + 1000)
  Picture1.Cls
  Picture1.Print i
  Picture1.Tag = i
End Sub

⌨️ 快捷键说明

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