【发布时间】:2013-09-08 18:05:20
【问题描述】:
我有一个有 5 列的表格:
我这样写代码:
String SQLQuery = "SELECT count(*) FROM aspnet_Users where Username=@uname AND Password = @pwd";
using(SqlConnection sqlConnection = new SqlConnection(strConnection))
using(SqlCommand command = new SqlCommand(SQLQuery, sqlConnection))
{
sqlConnection.Open();
command.Parameters.AddWithValue("@uname", Username);
command.Parameters.AddWithValue("@pwd", Password);
int result = Convert.ToInt32(command.ExecuteScalar());
boolReturnValue = (result > 0);
}
这里我需要一些额外的信息,如果上面的用户名和密码是正确的, 我需要的是:用户名和角色列数据
【问题讨论】:
-
我确实希望您在密码存储中使用某种形式的散列,而不仅仅是纯文本(并且使用适当的散列不仅仅是通过
sha256一次,可以在彩虹表或其他数据库),你不说如果你不是,我只是想检查你是。
标签: c# asp.net sql sql-server-2008