虚拟目录加页面地址 - GetLocalDirPath

2017-01-31 22:28:33  访问(1574) 赞(0) 踩(0)


        /// <summary>  
        /// 虚拟目录加页面地址  
        /// /WebSite/WebForms/WebPages/code/dotnet/HttpContextInfo/Info/ +
        /// </summary>  
        /// <returns></returns>  
        public string GetLocalDirPath()
        {
            string str = Request.Url.LocalPath;

            if (str == null)
                return "";

            int idx = str.LastIndexOf('/');

            if (idx == -1)
                return str;

            return str.Substring(0, idx);
        }


标签:虚拟目录加页面地址 - GetLocalDirPath 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)