您的位置:首页 > 产品设计 > UI/UE

在ashx一般处理程序文件中不能使用session和request的问题解决办法

2008-04-21 13:25 1036 查看
<%@ WebHandler Language="C#" Class="ChangePwd" %>

using System;
using System.Web;
using System.Web.SessionState;
public class ChangePwd : IHttpHandler, IReadOnlySessionState
{

public void ProcessRequest (HttpContext context)

{
context.Response.ContentType = "text/plain";
OperUser ou = new OperUser();
if (ou.ChangeWsPassword(context.Session["ws_user"].ToString(),context.Request.QueryString["pwd"].ToString()))
{
context.Response.Write("true");
}
else
{
context.Response.Write("flase");
}

}

public bool IsReusable {
get {
return false;
}
}

}

加上红色部分就可以了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: