zoukankan      html  css  js  c++  java
  • 今天看StarterKit.Communities中的关于获取路径部分,发现一个问题?难道老外也会不仔细看MSDN,还是?

    这是调用页的代码:
    --
     string requestPath = CommunityGlobals.RemovePathInfo(Context.Request.Path.ToLower());
    --
    CommunityGlobals.cs中
    ---
            //*********************************************************************
            //
            // RemovePathInfo Method
            //
            // Removes the extended information after a page path.
            // For example, removes the Web service information after
            // the .asmx file name.
            //
            //*********************************************************************
     
            public static string RemovePathInfo(string requestPath) {
                string _pathInfo = HttpContext.Current.Request.PathInfo;
                if (_pathInfo.Length == 0)
                    return requestPath;
                   
                return requestPath.Substring(0, requestPath.Length - _pathInfo.Length);   
           
            }

    ---

    大家看到了吧,老外没用用HttpRequest.FilePath来得到不带附加资源的url,呵呵
  • 相关阅读:
    JavaScript underscore
    JavaScript jQuery 事件、动画、扩展
    JavaScript jQuery 入门回顾
    JavaScript H5 Canvas
    JavaScript Ajax + Promise
    JavaScript 浏览器对象
    JavaScript 面向对象编程
    JavaScript 标准对象
    JavaScript 高阶函数 + generator生成器
    “耐撕”团队2016.04.12站立会议
  • 原文地址:https://www.cnblogs.com/jiangyu/p/8574.html
Copyright © 2011-2022 走看看