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,呵呵
  • 相关阅读:
    解决execjs 调用js 问题
    处理 get请求套字典问题
    js2py js逆向
    前端页面自适应
    newspaper抓新闻
    easygui
    pycharm 安装插件
    scrapy_代理使用
    SQLAlchemy 介绍,建表,及表的操作 (增 删 改 查)
    数据分析之pandas模块下
  • 原文地址:https://www.cnblogs.com/jiangyu/p/8574.html
Copyright © 2011-2022 走看看