📄 修改密码.frm
字号:
VERSION 5.00
Begin VB.Form xitong3
Caption = "修改密码"
ClientHeight = 3960
ClientLeft = 60
ClientTop = 465
ClientWidth = 5430
LinkTopic = "Form2"
Picture = "修改密码.frx":0000
ScaleHeight = 3960
ScaleWidth = 5430
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdChPwdCancel
Caption = "取 消"
Height = 495
Left = 2880
TabIndex = 9
Top = 3240
Width = 1455
End
Begin VB.CommandButton cmdChPwdOk
Caption = "确 定"
Height = 495
Left = 840
TabIndex = 8
Top = 3240
Width = 1455
End
Begin VB.TextBox txtNewPwdagain
Height = 405
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 3
Top = 2400
Width = 2055
End
Begin VB.TextBox txtNewPwd
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 2
Top = 1800
Width = 2055
End
Begin VB.TextBox txtOldPwd
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 1
Top = 1200
Width = 2055
End
Begin VB.TextBox txtChUser
Height = 375
Left = 2160
TabIndex = 0
Top = 600
Width = 2055
End
Begin VB.Label lblPwdagain
BackStyle = 0 'Transparent
Caption = "新密码确认:"
Height = 375
Left = 840
TabIndex = 7
Top = 2520
Width = 1095
End
Begin VB.Label lblNewPwd
BackStyle = 0 'Transparent
Caption = "新 密 码:"
Height = 375
Left = 840
TabIndex = 6
Top = 1920
Width = 975
End
Begin VB.Label lblOldPwd
BackStyle = 0 'Transparent
Caption = "原 密 码:"
Height = 375
Left = 840
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.Label lblChUser
BackStyle = 0 'Transparent
Caption = "用 户 名:"
Height = 375
Left = 840
TabIndex = 4
Top = 720
Width = 1095
End
End
Attribute VB_Name = "xitong3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdChPwdCancel_Click()
Unload Me
End Sub
Private Sub cmdChPwdOk_Click()
Dim rstUser As New ADODB.Recordset
Dim sql As String
'先检测两次输入的新密码时候一样
If txtNewPwd.Text <> txtNewPwdagain.Text Then
MsgBox "两次输入的密码不同!请重新输入", vbOKOnly + vbInformation, ""
'光标定位于新密码textbox中
txtNewPwd.SetFocus
Exit Sub
End If
'先检查此用户名及密码是否正确
sql = "select * from 用户 where 用户名 = '" & txtChUser.Text & "' and " _
& " 密码= '" & txtOldPwd.Text & "'"
rstUser.Open sql, conn, adOpenKeyset, adLockPessimistic
If rstUser.EOF = True Then
MsgBox "老用户名或密码错误!", vbOKOnly + vbExclamation, ""
txtChUser.Text = ""
txtChUser.SetFocus
txtOldPwd.Text = ""
rstUser.Close
Exit Sub
Else
rstUser.Fields(1) = txtNewPwd.Text
rstUser.Update
MsgBox "修改密码成功!", vbOKOnly + vbInformation, ""
rstUser.Close
Unload Me
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -