But my other code is now breaking. I have a change password facility. But i want to update the current password to a new password but encrypt it and send it in plain text via email at the same time :) (Here's where i get confused)
Would i be able to do this?
OleDbCommand cmd;
OleDbConnection conn;
string cmdString = "UPDATE tbl_taxicompanies SET password_test = @new_password" +
" WHERE ([password_test] = [@password]) AND ([username] = [@username])";
conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; " + "Data Source=|DataDirectory|test.mdb;" +
"Persist Security Info=False");
cmd = new OleDbCommand(cmdString, conn);
cmd.Parameters.Add("@new_password", OleDbType.VarChar, 50);
cmd.Parameters["@new_password"].Value = txt_new_password.Text;
cmd.Parameters.Add("@password", OleDbType.VarChar, 50);
cmd.Parameters["@password"].Value = txt_old.Text;
cmd.Parameters.Add("@username", OleDbType.VarChar, 50);
cmd.Parameters["@username"].Value = Session["username"].ToString();
conn.Open();
try
{
int count = cmd.ExecuteNonQuery();
MailMessage message = new MailMessage("noreply@csesalford.com", Session["email"].ToString());
//message.Subject = "RE: Password Changed";
message.Body = "Thanks " + Session["login_full_name"] + " for your request. Your password has not been changed to " +txt_new_password.Text+ ".";
SmtpClient client = new SmtpClient("mail.csesalford.com");
client.Send(message);
Response.Redirect("details_sent.aspx");
}
finally
{
conn.Close();
}
billy_111
Member
333 Points
878 Posts
Re: Login with MD5
Mar 24, 2009 08:53 PM|LINK
Hey,
I've figured that one, the working code is as follows:-
But my other code is now breaking. I have a change password facility. But i want to update the current password to a new password but encrypt it and send it in plain text via email at the same time :) (Here's where i get confused)
Would i be able to do this?
Thanks