有关代码的信息... [英] info about the code...

查看:85
本文介绍了有关代码的信息...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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?

推荐答案

请停止以任何名称针对每一行代码提问:买一本书.阅读.学点东西.
Please stop asking questions under either name about each and every line of code: Get a book. Read it. Learn something.
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.


此处 [<一个href ="http://msdn.microsoft.com/zh-cn/library/c8f5xwh7.aspx" target ="_ blank" title ="New Window"> ^ ]是一个简单的示例,您可以理解.
Here[^] is a simple example which you can understand.


这篇关于有关代码的信息...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆