摘要:
在Asp.Net 2.0里,已经能够在WebMethod里使用 Session 、 Application 这种服务器变量了。一、Session [WebMethod(EnableSession = true)] public string Hello() { return "Hello," + Session["user"]; } [WebMethod(EnableSession = false)] public string Hello1() { return "Hello," + Session["user" 阅读全文
摘要:
1protectedvoidPage_Load(objectsender,EventArgse)2{34using(SqlConnectionconn=newSqlConnection())5{6//dosomething7}89}IL查看:从图中可以看出:是在try{}finally{}中实现。IDisposable是对非托管资源释放,using真正实现的Dispose()是放在finally中实现。 阅读全文