using (Books bookDataAccess = new Books())
是什么意思???

解决方案 »

  1.   

    using (Books bookDataAccess = new Books())
    是说当在using 的{}运行结束之后,对bookDataAccess进行垃圾回收
      

  2.   

    不是,是调试的时候使用的输出。
    ApplicationLog应该是一个写应用程序日志的类。后面是用来记录调试信息的。
    The C# programming language's using statement makes a call to the Dispose method more automatic, by simplifying the code that you must write to create and clean up an object. 
      

  3.   

    不是,是调试的时候使用的输出。
    ApplicationLog应该是一个写应用程序日志的类。后面是用来记录调试信息的。
    The C# programming language's using statement makes a call to the Dispose method more automatic, by simplifying the code that you must write to create and clean up an object. 
      

  4.   

    作调试用的,当出现错误时产生堆栈信息并输出,在实际运行时不会起什么作用。
    using语句可以确保实现了IDisposable接口的类在执行完后立即执行Dispose方法,而不必等待CLR执行垃圾回收。
      

  5.   

    protected void Page_Load(Object sender, EventArgs e)
            {
                //
                // Ensure that the customer data is still in the session.
                //
                ApplicationAssert.Check(Customer != null, "No Customer at Account Edit", ApplicationAssert.LineNumber);
                
                if (null == Customer)
                {
                    //
                    // Session has probably timed out
                    //
                    ShoppingCart().Customer = null;
                    //
                    // Clear the logon cookie
                    //
                    FormsAuthentication.SignOut();
                    //
                    // Try to get back here and force reauthentication
                    //
                    Response.Redirect("account.aspx", false);
                }
            }