ashx文件要使用Session,必须实现Session接口; using System;using System.Web;using System.Web.SessionState; //第一步:导入此命名空间 public class 类名 : IHttpHandler ,IRequiresSessionState //第二步:实现接口 到此就可以像平时一样用Session了{ public void ProcessRequest (HttpContext context) {.…
using System; using System.Collections.Generic; using System.Linq; using System.Web; using PPT_DAL; namespace PPT_Web.tool { /// <summary> /// Login 的摘要说明 /// </summary> public class Login : IHttpHandler { public void ProcessRequest(HttpContex…
实现IHttpHandler接口的同时必须继承IRequiresSessionState接口,才能拿到session public class HttpHandler: IHttpHandler, IRequiresSessionState { public void ProcessRequest(HttpContext context) { string session=context.Session["NAME"].ToString(); }…