📄 changepass.frm
字号:
VERSION 5.00
Begin VB.Form MYPassword
BorderStyle = 3 'Fixed Dialog
Caption = "修改密码"
ClientHeight = 2130
ClientLeft = 5775
ClientTop = 3495
ClientWidth = 4575
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2130
ScaleWidth = 4575
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2640
TabIndex = 7
Top = 1560
Width = 975
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 375
Left = 960
TabIndex = 6
Top = 1560
Width = 975
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 20
PasswordChar = "*"
TabIndex = 5
Top = 960
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 20
PasswordChar = "*"
TabIndex = 4
Top = 600
Width = 2175
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 20
PasswordChar = "*"
TabIndex = 3
Top = 240
Width = 2175
End
Begin VB.Image Image1
Height = 480
Left = 3840
Picture = "changepass.frx":0000
Top = 480
Width = 480
End
Begin VB.Label Label3
Caption = "重新输入:"
Height = 255
Left = 360
TabIndex = 2
Top = 960
Width = 975
End
Begin VB.Label Label2
Caption = "新密码:"
Height = 255
Left = 360
TabIndex = 1
Top = 600
Width = 855
End
Begin VB.Label Label1
Caption = "旧密码:"
Height = 255
Left = 360
TabIndex = 0
Top = 240
Width = 855
End
End
Attribute VB_Name = "MYPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Sql As String
Dim Rs As ADODB.Recordset
'Set Rs = New ADODB.Recordset
'条件判断
'看旧密码是否正确
If Text1.Text <> Userpassword Then
MsgBox "您输入的密码不正确,请重新输入!", vbOKOnly + vbExclamation, "提示"
Text1.Text = ""
Text1.SetFocus
Exit Sub
End If
'看新密码是否匹配
If Text2.Text <> Text3.Text Then
MsgBox "新密码不匹配请重新输入!", vbOKOnly + vbExclamation, "提示"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Exit Sub
End If
'新密码不是空,是空则报错
If Text2.Text = "" Then '为空
MsgBox "为了安全起见,密码不能为空,请更正!", vbOKOnly + vbInformation, "提示"
Text2.SetFocus
Exit Sub
End If
'都通过了,则修改密码
Sql = "update userinfo set Userpassword='" & Text2.Text & "' " & "where Username='" & UserName & "'"
If Not mExecuteSql(Sql, Rs) Then '执行失败
MsgBox "密码修改失败!", vbOKOnly + vbExclamation, "提示"
Rs.Close
Unload Me
Exit Sub
Else
MsgBox "密码修改成功!", vbOKOnly + vbInformation, "提示"
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_LostFocus()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -