usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Data;
usingSystem.Web.SessionState;
namespacefriends{
///<summary>
///Handler的摘要说明
///</summary>
publicclassHandler:IHttpHandler,IRequiresSessionState{
publicvoidProcessRequest(HttpContextcontext){
context.Response.ContentType="text/plain";
在使用一般处理程序时,会用session,但是在ashx文件中,默认时,无法向session创建新的键值,写了就会报错,就会提示:“未将对象引用设置到对象的实例”
那么,将此ashx文件类继承一个接口,如以下所示: