开发者

I want to get part of the url in ASP.NET MVC

http://localhost:6223/RssFeed/RssFeedsLang?lang=Dari&开发者_如何学Goamp;cat=News

How can I get the http://localhost:6223/ of the url? Basically I want to discard /RssFeed/RssFeedsLang?lang=Dari&cat=News in the url. How can I do that?


Use this:

string urlBase = Request.Url.GetLeftPart( UriPartial.Authority ) + Request.ApplicationPath;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜