一般处理程序获取session值

1.要在一般处理程序中获取其他页面的session值,需要引用名空间:

using System.Web.SessionState;

2.然后继承一个接口:IRequiresSessionState,如图:

image

3.然后就可以获得session值了:

HttpContext context = new HttpContext();

string s =context.Session["Verifycode"].ToString();

posted @ 2013-09-10 15:00  【唐】三三  阅读(2555)  评论(0编辑  收藏  举报