📄 密码修改.frm
字号:
VERSION 5.00
Begin VB.Form frmpassword
Caption = "密码修改"
ClientHeight = 3975
ClientLeft = 5115
ClientTop = 5745
ClientWidth = 5520
Icon = "密码修改.frx":0000
LinkTopic = "Form4"
ScaleHeight = 3975
ScaleWidth = 5520
Begin VB.TextBox Text3
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 6
Top = 2280
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 5
Top = 840
Width = 1935
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 4
Top = 1560
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 3000
TabIndex = 3
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 375
Left = 1320
TabIndex = 2
Top = 3240
Width = 1095
End
Begin VB.Label Label3
Caption = "请确认"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 7
Top = 2400
Width = 855
End
Begin VB.Label Label2
Caption = "新密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 1
Top = 1680
Width = 855
End
Begin VB.Label Label1
Caption = "原密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 0
Top = 840
Width = 735
End
End
Attribute VB_Name = "frmpassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
superuser.MoveFirst
While Not superuser.EOF
If superuser.Fields(0) = username And superuser.Fields(1) = Text1.Text Then
superuser.Edit
If Text2.Text = "" Then
MsgBox "新口令不能为空!"
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "请确认新口令!"
Text3.SetFocus
Exit Sub
End If
If Text2.Text = Text3.Text Then
response = MsgBox("确定要修改吗?", vbYesNo)
If response = vbNo Then
Exit Sub
End If
superuser.Fields(1) = Text2.Text
Else
MsgBox "两次输入口令不一致!"
Text3.Text = ""
Text3.SetFocus
Exit Sub
End If
superuser.Update
MsgBox "口令已成功修改!"
'
Unload Me
Exit Sub
End If
superuser.MoveNext
Wend
hytable.MoveFirst
While Not hytable.EOF
If hytable.Fields(0) = username And hytable.Fields(1) = Text1.Text Then
hytable.Edit
If Text2.Text = "" Then
MsgBox "新口令不能为空!"
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "请确认新口令!"
Text3.SetFocus
Exit Sub
End If
If Text2.Text = Text3.Text Then
response = MsgBox("确定要修改吗?", vbYesNo)
If response = vbNo Then
Exit Sub
End If
hytable.Fields(1) = Text2.Text
Else
MsgBox "两次输入口令不一致!"
Text3.Text = ""
Text3.SetFocus
Exit Sub
End If
hytable.Update
MsgBox "密码已成功修改!"
'Exit Sub
Unload Me
Exit Sub
End If
hytable.MoveNext
Wend
MsgBox "原口令不正确!"
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Print username
End Sub
Private Sub Form_Load()
Form1.Enabled = False
dcpath = "c:\点菜系统.mdb"
Set dcdb = OpenDatabase(dcpath)
Set superuser = dcdb.OpenRecordset("超级用户", dbOpenTable)
Set hytable = dcdb.OpenRecordset("会员表", dbOpenTable)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Enabled = True
dcdb.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -