http://localhost:6223/RssFeed/RssFeedsLang?lang=Dari&cat=News
如何获取网址的http://localhost:6223/
?基本上我想丢弃网址中的 /RssFeed/RssFeedsLang?lang=Dari&cat=News
。我怎样才能做到这一点?
最佳答案
使用这个:
string urlBase = Request.Url.GetLeftPart( UriPartial.Authority ) + Request.ApplicationPath;
关于c# - 我想获取 ASP.NET MVC 中的部分 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3924533/