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

作者最新文章
ASP.NET, ASP.NET Core WebApi 返回 Controller 返回 Json 类型结果
Visual Studio 调试 ASP.NET Core 无法连接 IIS Express 服务器
ASP.NET WebApi 与 ASP.NET Core WebApi 返回 HttpResponseMessage
SQL Server 中 CASE WHEN 使用
html table 设置表格背景图片,背景色