如何修改密码? [英] How to change password?
本文介绍了如何修改密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有四个字段:旧密码,新密码,确认密码和更改密码按钮.
我想要C#源代码来更改数据库的密码.请帮帮我....
[我们不只是提供代码.]
I have four fields: old password, new password, confirm password and a change password button.
I want C# source code for changing password with respect to the database. Please help me out....
[We don''t just provide code.]
推荐答案
首先使用数据库密码字段检查旧密码
如果密码匹配,则
如果(newpassword.text == confirmpasswd.text)
{
"UPDATE tablename SET PASSWORD =""+ newpassword.text +"''''WHERE条件"
}
first check the old password with database pass word field
if the password match then
if (newpassword.text==confirmpasswd.text)
{
"UPDATE tablename SET PASSWORD=''" +newpassword.text +"'''' WHERE condition"
}
尝试更改:
Try changing:
cmd.CommandText = " update tbl_Leads set User_Password="txtNewPassword.Text" where User_Id="Session["sUserId"]"";
到
to
cmd.CommandText = " update tbl_Leads set User_Password=@User_Password where User_Id="Session["sUserId"]"";
这篇关于如何修改密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文