更新时间:2023-09-21 23:36:10
查看以下内容是否有用。
See if the following is helpful.
https://***.com/questions/14211973/get-host-domain-from-url
从上面的链接
string host = Request.Url.Host;
和
Uri myUri = new Uri("http://www.contoso.com:8080/");
string host = myUri.Host; // host is "www.contoso.com"
Uri.GetLeftPart( UriPartial.Authority )