嗨,有人知道为什么我会收到这个错误。
这是我得到错误的行
return (string)row[0] == password && (long)row[1] == 0 && (long)row[2] == 1;
这里有一些代码,
if (!Utils.IsNullOrWhiteSpace(account) && !Utils.IsNullOrWhiteSpace(password))
{
List<List<object>> table = ExecuteReader("SELECT password, banned, confirmed FROM accounts WHERE name=@name", new SqliteParameter("@name", account));
if (table.Count == 1)
{
// account exists. check password and ban status.
List<object> row = table[0];
//return (string)row[0] == password && (long)row[1] == 0;
return (string)row[0] == password && (long)row[1] == 0 && (long)row[2] == 1;
}
else
{
return false;
// account doesn't exist. create it.
ExecuteNonQuery("INSERT INTO accounts VALUES (@name, @password, 0)", new SqliteParameter("@name", account), new SqliteParameter("@password", password));
return true;
}
}
return false;
}