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,呵呵
  • 相关阅读:
    java poi 从服务器下载模板写入数据再导出
    一个华为面试题
    ForEach 循环
    fmt标签格式化数字和时间
    Ichars制作数据统计图
    jQuery中的事件
    oracle学习第四天
    GET请求和POST请求
    Jsp的九个隐含对象
    Oracle学习【语句查询】
  • 原文地址:https://www.cnblogs.com/jiangyu/p/8574.html
Copyright © 2011-2022 走看看