asp.net mvc 获取网站的BasePath
更新:HHH   时间:2023-1-7


 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;

            }

        }


返回编程语言教程...