?protected void Button1_Click(object sender, EventArgs e) ??????? { ??????????? string new_pwd = D5(TextBox2.Text); ??????????? SqlConnection conn = new SqlConnection("database='111';uid='sa';pwd='lan'"); ??????????? string str_comm = "insert into uName values(" + TextBox1.Text + "," + new_pwd + ")"; ??????????? conn.Open(); ??????????? SqlCommand comm = new SqlCommand(str_comm,conn); ??????????? comm.ExecuteNonQuery(); ??????????? conn.Close(); ??????????? Response.Write("<script>alert('成功添加~~')</script>");
??????? } ??????? public string D5(string strPwd) ??????? { ??????????? MD5 md5 = new MD5CryptoServiceProvider(); ??????????? byte[] data = System.Text.Encoding.Default.GetBytes(strPwd); ??????????? byte[] md5data = md5.ComputeHash(data); ??????????? md5.Clear(); ??????????? string str = ""; ??????????? for (int i = 0; i < md5data.Length - 1;i++ ) ??????????? { ??????????????? str += md5data[i].ToString("x").PadLeft(2,'0'); ??????????? } ??????????? return str; ??????? }
為什么會顯示列名無效 ??兩個TextBox
眼眸繁星
2018-12-07 09:29:24