- 打卡等级:即来则安
- 打卡总天数:29
- 打卡月天数:1
- 打卡总奖励:7791
- 最近打卡:2025-12-13 17:25:16
管理员
- 积分
- 21301
|
ASP.NET 显示所有Cookies, Session, Application- // Session
- Response.Write("Session的所有值:<br />");
- foreach (string obj in Session.Contents)
- {
- Response.Write(obj.ToString() + ":" + Session[obj] + "<br />");
- }
-
- // Cookies
- Response.Write("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 />");
- }
-
- // Application
- Response.Write("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 />");
- }
复制代码 来源:C#社区
网址:www.hicsharp.com
|
|