using System; using System.Data; using System.Data.SqlClient; // ******** using System.Configuration; using System.Collections; using System.Security.Cryptography; // ******** using System.Text; // ******** using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class admin_abi : System.Web.UI.Page { protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection( ConfigurationManager.ConnectionStrings["yhendusTekst"].ConnectionString); SqlCommand cmd = new SqlCommand( "UPDATE Kasutaja_tbl SET paroolSHA = @pwd WHERE KasutajaNimi = @kasutaja", conn); SHA1 sha = new SHA1CryptoServiceProvider(); // cmd.Parameters.AddWithValue("@pwd", sha.ComputeHash(Encoding.Unicode.GetBytes(TextBox1.Text))); // cmd.Parameters.AddWithValue("@kasutaja", User.Identity.Name.ToUpper()); cmd.Parameters.AddWithValue("@pwd", sha.ComputeHash(Encoding.Unicode.GetBytes("kala"))); cmd.Parameters.AddWithValue("@kasutaja", "ERKI"); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } }