C# 我想在ASP.NET MVC中获取部分url

C# 我想在ASP.NET MVC中获取部分url,c#,asp.net-mvc,C#,Asp.net Mvc,如何获取http://localhost:6223/的url地址?基本上,我想放弃url中的/RssFeed/RssFeedsLang?lang=Dari&cat=News。我如何才能做到这一点?使用以下方法: http://localhost:6223/RssFeed/RssFeedsLang?lang=Dari&cat=News string urlBase = Request.Url.GetLeftPart( UriPartial.Authority ) + Request.Ap

如何获取
http://localhost:6223/
的url地址?基本上,我想放弃url中的
/RssFeed/RssFeedsLang?lang=Dari&cat=News
。我如何才能做到这一点?

使用以下方法:

http://localhost:6223/RssFeed/RssFeedsLang?lang=Dari&cat=News
string urlBase = Request.Url.GetLeftPart( UriPartial.Authority ) + Request.ApplicationPath;