ASP.NET 显示所有Cookies, Session, Application

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 />");
            }

作者最新文章
Winform TextBox (文本框) 密码输入框, 输入内容显示*号 (星号)
Winform 启动前弹出登录界面, 登录成功之后再显示主界面
C# 字符串string和字符数组char[]的相互转换
C# 字符串倒序输出, 实现字符串倒序的方法
Winform 如何从 TextBox(文本框) 控件读取每一行数据到数组