首页  :: 订阅 订阅  :: 管理

如何让 IHttpHandler 抓住session,使用 IRequiresSessionState

Posted on 2005-04-21 14:53  GaoJie[高杰]  阅读(534)  评论(0)    收藏  举报
using System.Web.SessionState


public class my_Handle:IHttpHandler
{

}
这个类只能抓到所有的 html 内容,为了能够抓到 session,在我们的类中必须实现 System.Web.SessionState.IRequiresSessionState 接口,这样,我们就可以读到 session 内容,同时增加 session item

===============================================================================
below is the msdn help
===============================================================================

If your handler will access session state values, it must implement the IRequiresSessionState interface (a marker interface with no methods).

Specifies that the target HTTP handler interface has read and write access to session-state values. This is a marker interface only and has no methods.