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

推荐订阅源

D
DataBreaches.Net
罗磊的独立博客
雷峰网
雷峰网
量子位
V
Visual Studio Blog
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
月光博客
月光博客
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
腾讯CDC
Engineering at Meta
Engineering at Meta
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Jina AI
Jina AI
A
About on SuperTechFans

博客园 - 小飞虫

JS获取URL参数值 - 小飞虫 - 博客园 PHP时间戳 Mysql 备注数据库脚本 gridview 为CommandArgument绑定行号 .net 3.5 属性简写 有效解决CSS兼容性的技巧 DropDownList绑定枚举类型 如何避免DropDownList绑定无效值时抛出异常 网上找的JS身份证验证,修复了一个日期验证的bug 几个js的正则表达式验证 通过javascript修改文本框内容后提交 正则表达表手机号码 修改成员管理默认的密码规则 js密码验证 js邮件地址验证脚本 asp.net 上传图片并生成缩略图 .net2.0邮件发送程序 从框架中关闭浏览器的JS脚本 关于web.config的问题
遍历 Session,Cookie,Application
小飞虫 · 2010-09-29 · via 博客园 - 小飞虫

代码

        Response.Write("<br>Session的所有值:<br>");
        
foreach (string obj in Session.Contents)
        {
            Response.Write(obj.ToString() 
+ ":" + Session[obj] + "<br>");
        }
        Response.Write(
"<br>CookiEs的所有值:<br>");for (int i = 0; i < HttpContext.Current.Request.Cookies.Count; i++)
        {

            Response.Write(HttpContext.Current.Request.Cookies.Keys[i] 

+ ":" + HttpContext.Current.Request.Cookies[i].Value.ToString() + "<br>");

        }

        Response.Write(

"<br>Application的所有值:<br>");for (int i = 0; i < HttpContext.Current.Application.Count; i++)
        {

            Response.Write(HttpContext.Current.Application.Keys[i] 

+ ":" + HttpContext.Current.Application[i].ToString() + "<br>");

        }