请教高手 如何写代码做修改密码的窗口 急~~~

来源:百度知道 编辑:UC知道 时间:2024/05/16 08:06:15
界面是

旧密码 ______
新密码 ______
确定新密码 ______

确定 取消

代码编写在确定的click事件中
要完成验证密码是否正确 修改是否成功等功能
密码放在数据库中

你打算把密码放在那儿呢?是放在数据库还是固定一个呢?如果放在数据库里面的话才可以修改密码呀..或者放在其它文件里面.
private sub command1_click()
if text1.text<>"" or text2.text<>"" or text3.text<>""then
if text2.text=text3.text then
if text1.text=oldkey then '如果 text1.text=旧密码
oldkey=text3.text
else
msgbox "密码错误"
end if
else
msgbox "密码重复错误,请重新输入"
end if
else
msgbox "密码不能为空"
end if

Private Sub Command1_Click()
If Text3.Text = Text2.Text Then
MsgBox "密码修改成功"
Else: MsgBox "两次输入的密码不一样"
End If
End Sub

Private Sub Form_Load()
Text2.Enabled = False
Text3.Enabled = False

End Sub

Private Sub Text1_Change()
If Text1.Text = 123 Then
Text2.Enabled = True
Text3.Enabled = True
End If
End Sub

把text2he text3的password属性设置为*<