📄 frmmodifypwd.frm
字号:
VERSION 5.00
Begin VB.Form frmModifyPwd
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 2460
ClientLeft = 45
ClientTop = 330
ClientWidth = 4425
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2460
ScaleWidth = 4425
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCertain
Caption = "确定"
Default = -1 'True
Height = 390
Left = 915
TabIndex = 3
Top = 2010
Width = 930
End
Begin VB.CommandButton cmdCancle
Caption = "取消"
Height = 390
Left = 2970
TabIndex = 4
Top = 2010
Width = 930
End
Begin VB.TextBox txtOldPwd
Height = 345
IMEMode = 3 'DISABLE
Left = 1620
PasswordChar = "*"
TabIndex = 0
Top = 690
Width = 2715
End
Begin VB.TextBox txtNewPwd
Height = 345
IMEMode = 3 'DISABLE
Left = 1620
MaxLength = 50
PasswordChar = "*"
TabIndex = 1
ToolTipText = "请输入新密码,长度要小于50个字符"
Top = 1125
Width = 2715
End
Begin VB.TextBox txtNewPwd2
Height = 345
IMEMode = 3 'DISABLE
Left = 1620
MaxLength = 50
PasswordChar = "*"
TabIndex = 2
ToolTipText = "请再次输入你的新密码"
Top = 1545
Width = 2715
End
Begin VB.TextBox txtUsername
Height = 375
Left = 1620
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 240
Width = 2715
End
Begin VB.Label Label1
Caption = "原密码:"
Height = 315
Left = 150
TabIndex = 9
Top = 735
Width = 1200
End
Begin VB.Label Label2
Caption = "新密码:"
Height = 315
Left = 150
TabIndex = 8
Top = 1170
Width = 1080
End
Begin VB.Label Label3
Caption = "重复新密码:"
Height = 240
Left = 120
TabIndex = 7
Top = 1590
Width = 1170
End
Begin VB.Label Label4
Caption = "用户名(&U)"
Height = 225
Left = 150
TabIndex = 6
Top = 300
Width = 945
End
End
Attribute VB_Name = "frmModifyPwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancle_Click()
Unload Me
End Sub
Private Sub cmdCertain_Click()
If txtOldPwd.Text = userPassword Then '原密码正确
If txtNewPwd.Text <> txtNewPwd2.Text Then
MsgBox "两次新密码输入不一致!请重新输入!", , "提示"
Else
cn.Open
Set rs.ActiveConnection = cn
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
rs.Open "select 用户名,密码 from 用户密码表 where 用户名 = '" & txtUsername.Text & "'"
rs.Fields("密码") = txtNewPwd.Text
rs.Update
rs.Close
cn.Close
End If
MsgBox "密码已修改成功", , "提示"
Unload Me
Else '原密码错误
MsgBox "原密码输入错误,输入密码要使用正确的大小写", , "提示"
txtOldPwd.Text = ""
txtNewPwd.Text = ""
txtNewPwd2.Text = ""
txtOldPwd.SetFocus
End If
End Sub
Private Sub Form_Load()
txtUsername.Text = userName
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -