本文介绍了有关代码的信息...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
protected void ctlLogin_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false; what this line do?
Authenticated = UserAuthenticate(ctlLogin.UserName, ctlLogin.Password);
e.Authenticated = Authenticated; what this line do?
if (Authenticated == true)
{
Response.Redirect("information1.aspx");
}
}
private bool UserAuthenticate(string UserName, string Password)
{
bool boolReturnValue = false; what this line do?
//--------------------------------
//Check UserID From Config File
//--------------------------------
dt = new DataTable();
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\omar\Documents\Visual Studio 2005\WebSites\Project1\App_Data\Database.mdf;Integrated Security=True;User Instance=True");
string chkUser = "Select * FROM [User] where Email='" + UserName + "' AND Password='" + Password + "'";
dt = dbClass.ConnectDataBaseReturnDT(chkUser);
if (dt.Rows.Count > 0)
{
boolReturnValue = true;
Session["Id"] = dt.Rows[0]["Id"].ToString();
string que = "UPDATE [User] SET LastLogin = GETDATE() where Id=" + Session["Id"].ToString();
// DateTime registerdate = (DateTime)dt.Rows[0]["RegisterDate"];
//string que1 = "UPDATE [User] SET RegisterDate = GETDATE() where Id=" + Session["UserId"].ToString();
dbClass.ConnectDataBaseToInsert(que);
//dbClass.ConnectDataBaseToInsert(que1);
}
return boolReturnValue; what this line do?
}
请解释该代码中的bool功能吗?
plz explain the what bool do in this code?
推荐答案
bool boolReturnValue = false;
如果您现在还无法弄清楚这行代码的作用,那么也许您应该考虑一个新的职业.
也许是零售快餐.
If you can''t work out what this line of code does by now, then perhaps you should consider a new career.
Retail Fast Food, perhaps.
这篇关于有关代码的信息...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!