试试这样如何using System.Web.SessionState;在类后面增加一个Interfacepublic class Handler1 : IHttpHandler,IRequiresSessionState