using System.Web; using System; using System.Web.SessionState;//需要引用 /// <summary> /// MyHandler 的摘要说明 /// </summary> public class MyHandler : IHttpHandler, IReadOnlySessionState //需要实现IReadOnlySessionState接口 { public MyHandler() { } public void ProcessRequest(HttpContext context) { context.Response.Write(context.Session["aa"]); } public bool IsReusable { get { return false; } } }