在自己写的C#类中调用 ASP.NET的Request,server 等对象

加命名空间(可能需要在项目中先加引用,再在类中如下引用)

using System.Web.SessionState; HttpContext.Current.Session["TotalPage"].ToString(); HttpContext.Current.Request.QueryString["cid"].ToString();