在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;
}
}
}
加上红色部分就可以了
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;
}
}
}
加上红色部分就可以了
相关文章推荐
- 在ashx一般处理程序文件中不能使用session和request的问题解决办法
- ASP.NET一般处理程序(.ashx.cs)中使用Session的问题
- C#一般处理程序 ashx.cs使用Session报错问题
- 使用ashx一般处理程序,读取不到Session的问题
- 使用ashx一般处理程序,读取不到Session的问题
- 一般处理程序不能使用Session的问题
- 一般处理文件.ashx中使用文件session遇到的问题
- 抛开cookie使用session-PHP中SESSION不能跨页传递问题的解决办法
- WINXP+IIS5.1不能打开aspx文件的的问题之解决办法(一般为IIS安装顺序)
- *.ashx一般处理程序不能访问Session值的解决方法
- 一般处理程序.ashx文件SESSION读写
- ASP.NET的ASHX一般处理程序中Session为null且不能赋值
- 一般处理程序(.ashx)中session的使用方法
- 在ashx一般处理程序中使用session
- IIS中预览错误问题的解决办法(HTTP 错误 404.3 - Not Found 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射 )
- 一般处理程序(.ashx)中使用Session
- ASP.NET的ASHX一般处理程序中Session为null且不能赋值
- 关于处理程序文件(ashx)中调用Session的解决方法
- ahsx一般处理程序无法获取Session的值解决办法
- 一般处理程序(后缀为.ashx)里面使用Session,直接使用Session会报实例错误