惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

博客园 - 脑瓜子

博文阅读密码验证 - 博客园 开发 SQLite学习手册(转) 缓存数据库redis、memcached。 MongoDB 资源集锦 在GOOGLE浏览器中模拟移动浏览器 调试Web app 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 Intelligencia.UrlRewriter在IIS 7.0下的完全配置攻略 脑瓜子的文章导航 脑瓜子的学院系列文章汇总 博文阅读密码验证 - 博客园 ASP.NET中上传图片检测其是否为真实的图片 防范病毒上传至服务器 ASP.NET MVC 中实现View与Controller分离 [开源]C#中开源软件大汇总(外国的) 百度知道回答内容呈现给大家分享下 团购网是否能拯救那些因为运费问题而滞销的农产品? 个人的用户体验感想+点评jobily 发的日志 作为一个技术人员,终于有了自己的第一个作品 博文阅读密码验证 - 博客园
HttpHandler(ashx)中获取Session状态 - 脑瓜子 - 博客园
脑瓜子 · 2010-08-25 · via 博客园 - 脑瓜子

当想要在HttpHandler(ashx文件)中访问Session的状态值时,需要显式的实现一个接口 IReadOnlySessionState,示例如下:

<% @ webhandler language="C#" class="DownloadHandler" %>
using System;
using System.Web;
using System.Web.SessionState ;

public class DownloadHandler : IHttpHandler,  IReadOnlySessionState
{
  public bool IsReusable { get { return true; } } 
  
}

如果要读写Session的值,那么只要实现 IRequiresSessionState 接口就可以了,这两个接口没有待实现的方法,可直接使用。

           

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
如果文章对您有用,帮我点一下『好文要顶』,或是点一下『推荐』,这会让我更有动力的为各位读者撰写下一篇文章。
非常谢谢各位的支持与爱护,在此跟各位说声谢谢!!! ^_^