📄 修改密码窗口.frm
字号:
VERSION 5.00
Begin VB.Form chgpwd
Caption = "修改密码窗口"
ClientHeight = 4695
ClientLeft = 4560
ClientTop = 3795
ClientWidth = 6510
LinkTopic = "Form1"
ScaleHeight = 4695
ScaleWidth = 6510
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3600
TabIndex = 7
Top = 2880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 6
Top = 2880
Width = 1095
End
Begin VB.TextBox Text3
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 5
Top = 1680
Width = 1695
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 4
Top = 960
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 3
Top = 240
Width = 1695
End
Begin VB.Label Label3
Caption = "密码确认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 2
Top = 1800
Width = 975
End
Begin VB.Label Label2
Caption = "新密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 1
Top = 1080
Width = 975
End
Begin VB.Label Label1
Caption = "旧密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 0
Top = 360
Width = 975
End
End
Attribute VB_Name = "chgpwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Opwd As String
Dim Npwd As String
Dim Npwd1 As String
Opwd = Trim$(Text1.Text)
Npwd = Trim$(Text2.Text)
Npwd1 = Trim$(Text3.Text)
If Opwd = "" Then
MsgBox "旧密码不能为空,请输入旧密码!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Exit Sub
End If
If Npwd = "" Then
MsgBox "新密码不能为空,请输入新密码!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Exit Sub
End If
If Npwd1 = "" Then
MsgBox "新密码确认不能为空,请输入新密码确认!", vbOKOnly + vbExclamation, "警告"
Text3.SetFocus
Exit Sub
End If
If Npwd <> Npwd1 Then
MsgBox "新密码和新密码确认不一致,请重新输入新密码和新密码确认!", vbOKOnly + vbExclamation, "警告"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Exit Sub
End If
Dim rs As ADODB.Recordset
txtSQL = "select * from muser where user_name='" & UserName & "' and user_pwd='" & Opwd & "'"
Set rs = ExecuteSQL(txtSQL, txtmsg)
If rs.EOF = True Then
MsgBox "旧密码错误,请重新输入旧密码!", vbOKOnly + vbExclamation, "警告"
Text1.Text = ""
Text1.SetFocus
Exit Sub
Else
txtSQL = "update muser set user_pwd='" & Npwd & "' where user_name='" & UserName & "'"
Set rs = ExecuteSQL(txtSQL, txtmsg)
MsgBox "密码修改成功!", vbOKOnly + vbExclamation, "警告"
Me.Hide
Unload chgpwd
End If
Set rs = Nothing
End Sub
Private Sub Command2_Click()
Me.Hide
Unload chgpwd
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -