首页 > Web开发 > 详细

asp.net mvc 获取网站的BasePath

时间:2015-07-01 18:37:22      阅读:382      评论:0      收藏:0      [点我收藏+]

 public string BasePath

        {

            get

            {

                string ip_port = Request.Url.GetLeftPart(UriPartial.Authority);

                if (!string.IsNullOrWhiteSpace(ip_port) && ip_port.Contains("62.155.197.173"))

                {

                    ip_port = "http://62.155.197.173:1888";

                }

                string basePath = ip_port + "/";

                return basePath;

            }

        }


asp.net mvc 获取网站的BasePath

原文:http://2199270.blog.51cto.com/2189270/1669803

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!