zoukankan      html  css  js  c++  java
  • asp.net 取得URL信息

    AbsolutePath = "/ReportManage/ReportWindow.aspx"

    AbsoluteUri = "http://localhost:18725/ReportManage/ReportWindow.aspx?action=PickGoodsInfo&keyid=4ffeb15b-c269-451a-95a0-1eb22cbefd18"

    Authority = "localhost:18725"

    Host = "localhost"

    LocalPath = "/ReportManage/ReportWindow.aspx"


    OriginalString = "http://localhost:18725/ReportManage/ReportWindow.aspx?action=PickGoodsInfo&keyid=4ffeb15b-c269-451a-95a0-1eb22cbefd18"


    PathAndQuery = "/ReportManage/ReportWindow.aspx?action=PickGoodsInfo&keyid=4ffeb15b-c269-451a-95a0-1eb22cbefd18"


    Query = "?action=PickGoodsInfo&keyid=4ffeb15b-c269-451a-95a0-1eb22cbefd18"


    Segments = {string[3]}
    [0] = "/"
    [1] = "ReportManage/"
    [2] = "ReportWindow.aspx"

     顺便给出以下地址的方法,给到多少级,自己看着用Length-n

     http://localhost:18725/ReportManage/

                string[] webnet=new string[Context.Request.Url.Segments.Length-1];

                Array.Copy (Context.Request.Url.Segments,webnet ,Context.Request.Url.Segments.Length-1);

    Context.Request.Url.Authority + string.Join("", webnet) 

    网上90%的,不知道是不是版本的问题,都是错误的,寒一个!!

  • 相关阅读:
    js splice 属性实现数组的删除,插入,替换
    js var多等式变量的定义
    SQL Server 收缩数据库
    sql2005 全文索引
    显示器分辨率推荐
    使用javascript打开链接的多种方法
    运算优先级
    jqGrid
    asp.net IE 页面刷新固定位置
    Left Join ,On Where
  • 原文地址:https://www.cnblogs.com/szyicol/p/1808762.html
Copyright © 2011-2022 走看看