zoukankan      html  css  js  c++  java
  • Net 常用代码

    循环输出cookie信息

    for (int i = 0; i < Request.Cookies.Count; i++)
    {
    HttpCookie cookies
    = Request.Cookies[i];
    Response.Write(
    "name=" + cookies.Name + "<br>");
    if (cookies.HasKeys)
    {
    System.Collections.Specialized.NameValueCollection Namecall
    = cookies.Values;
    for (int j = 0; j < Namecall.Count; j++)
    {
    Response.Write(
    "子键名=" + Namecall.AllKeys[j] + "<br/>");
    Response.Write(
    "子键值=" + Namecall[j] + "<br/>");
    }
    }
    else
    {
    Response.Write(
    "value=" + cookies.Value + "<br/>");
    }
    }

    第二种代码着色!

    for (int i = 0; i < Request.Cookies.Count; i++)
            {
                HttpCookie cookies = Request.Cookies[i];
                Response.Write("name=" + cookies.Name + "<br>");
                if (cookies.HasKeys)
                {
                    System.Collections.Specialized.NameValueCollection Namecall = cookies.Values;
                    for (int j = 0; j < Namecall.Count; j++)
                    {
                        Response.Write("子键名=" + Namecall.AllKeys[j] + "<br/>");
                        Response.Write("子键值=" + Namecall[j] + "<br/>");
                    }
                }
                else
                {
                    Response.Write("value=" + cookies.Value + "<br/>");
                }
            }
    
    System.Web.HttpContext.Current.Server.MapPath()
    System.Web.HttpContext.Current.Session
    System.Web.HttpContext.Current.Response
    string spath = HttpContext.Current.Request.Path; /productlist.aspx
    HttpContext.Current.Request.UrlReferrer//获取上一页面地址
    Context.Request.UserHostAddress
  • 相关阅读:
    calc, support, media各自的含义及用法?
    vuex有哪几种属性
    vue-router实现路由懒加载( 动态加载路由 )
    vue生命周期的理解
    vue初始化页面闪动问题
    .params和query的区别
    实现布局数据渲染以列为单位
    一. async函数
    一. includes
    十五. 对象的扩展
  • 原文地址:https://www.cnblogs.com/neve/p/1997754.html
Copyright © 2011-2022 走看看