asp.net handler的使用源代码
示例1: using System; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.SessionState; namespace MyHandler { /// <summary> /// 目的:实现一个简单的自定义HttpHandler容器 /// 作者:文野 /// 联系:stwyhm@cnblogs.com /// </summary> public class MyFirstHandler : IHttpHandler,IRequiresSessionState { #region IHttpHandler 成员 public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { context.Response.Write("<h1><b>Hello HttpHandler</b></h1>"); context.Session["Test"] = "测试HttpHandler容器中调用Session"; context.Response.Write(context.Session["Test"]); } #endregion } }
- 1
- 粉丝: 39
- 资源: 94
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助