首先引用:using System.Web.SessionState; 再在 IHttpHandler后面加逗号加IReadOnlySessionState:IHttpHandler,IReadOnlySessionStatecontext.Session["xxx"]就可以取到session的值