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

📄 frmchgpwd.frm

📁 企业人事管理系统,有考勤,人员管理等功能,值得研究,也是我付费弄来的,绝对超值
💻 FRM
字号:
VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form frmChgPwd 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "修改密码"
   ClientHeight    =   3195
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   Icon            =   "frmChgPwd.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   Begin VB.Frame Frame1 
      Height          =   2295
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4335
      Begin VB.TextBox txtNewPwdt 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   1800
         Width           =   2415
      End
      Begin VB.TextBox txtNewPwd 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   1320
         Width           =   2415
      End
      Begin VB.TextBox txtOldPwd 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   840
         Width           =   2415
      End
      Begin VB.TextBox txtName 
         Height          =   270
         Left            =   1560
         TabIndex        =   1
         Top             =   360
         Width           =   2415
      End
      Begin VB.Label Label4 
         Caption         =   "密码确认:"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   1800
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "新的密码:"
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   1320
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "旧的密码:"
         Height          =   375
         Left            =   240
         TabIndex        =   6
         Top             =   840
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "账号 :"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   360
         Width           =   975
      End
   End
   Begin MSForms.CommandButton cmdReturn 
      Height          =   375
      Left            =   2640
      TabIndex        =   10
      Top             =   2640
      Width           =   1095
      Caption         =   "返回"
      Size            =   "1931;661"
      FontName        =   "宋体"
      FontHeight      =   180
      FontCharSet     =   134
      FontPitchAndFamily=   34
      ParagraphAlign  =   3
   End
   Begin MSForms.CommandButton cmdSure 
      Height          =   375
      Left            =   840
      TabIndex        =   9
      Top             =   2640
      Width           =   1095
      Caption         =   "确定"
      Size            =   "1931;661"
      FontName        =   "宋体"
      FontHeight      =   180
      FontCharSet     =   134
      FontPitchAndFamily=   34
      ParagraphAlign  =   3
   End
End
Attribute VB_Name = "frmChgPwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdReturn_Click()
 Unload Me
End Sub

Private Sub cmdSure_Click()
 Dim strSql As String
 Dim strMsg As String
 Dim strUser As String
 Dim strPwd As String
 Dim strNPwd As String
 Dim strNPwdt As String
 Dim rs As New ADODB.Recordset
 
 '取得相关数据到变量
 strUser = Trim(txtName)
 strPwd = Trim(txtOldPwd)
 strNPwd = Trim(txtNewPwd)
 strNPwdt = Trim(txtNewPwdt)
 
 
 If strUser = "" Then
   MsgBox ("用户名不能为空")
   txtName = ""
   TextFocus txtName
   Exit Sub
 End If
 
 
 If strPwd = "" Or strNPwd = "" Or strNPwdt = "" Then
   MsgBox ("密码不能为空")
   TextFocus txtOldPwd
   Exit Sub
 End If
 
 If strNPwd <> strNPwdt Then
   MsgBox "两次密码不一致!"
   TextFocus txtNewPwd
   Exit Sub
 End If
 
 strSql = "select * from t_user where 用户='" & strUser & "'"
 Set rs = ExecuteSQL(strSql, strMsg)
 
 If rs.EOF Then
   MsgBox "没有此用户"
   txtName = ""
   TextFocus txtName
   Exit Sub
 End If
  
 rs.Close
 
  strSql = "update t_user set 密码='" & strNPwd & "'"
  Set rs = ExecuteSQL(strSql, strMsg)
  
  MsgBox "密码修改成功!"
  Unload Me
End Sub

Private Sub Form_Load()
 Me.Left = ReadIni("修改密码", "left")
 Me.Top = ReadIni("修改密码", "top")
End Sub

Private Sub Form_Unload(Cancel As Integer)
 Call WriteIni("修改密码", "left", Me.Left)
 Call WriteIni("修改密码", "top", Me.Top)
End Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

⌨️ 快捷键说明

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