をハッシュするために
//Instantiate a new Hasher Object
var hasher = new Hasher();
hasher.SaltSize = 16;
//Encrypts The password
var encryptedPassword = hasher.Encrypt(txtPass.Text);
Account newUser = new Account();
newUser.accnt_User = txtUser.Text;
newUser.accnt_Position = txtPosition.Text;
newUser.accnt_Pass = encryptedPassword;
と私はEncryptoを使用しています詐欺にSQLカラムがバイナリタイプの場合は、encryptedPassword文字列をバイト配列に変換します。 だからではなく、ラインの
newUser.accnt_Pass = encryptedPassword;
その後
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
newUser.accnt_Pass = new System.Data.Linq.Binary(encoding.GetBytes(encryptedPassword));
Rを入れて?それを私のテーブルに直接挿入できますか? – user962206
私は答えを更新しました。 –
よろしくお願いします。ところで、別のアカウントに同じパスワードを挿入したとき(どうやってテストするのですか)、どちらも異なる値がありますか?入力されたものがデータベースのものと同じであるかどうかはどのようにわかりますか? – user962206