开发者

Find Website Name from a web application

I have two web site sites on IIS 7 (Default, Custom). Both Sites host the same web application.

Some of the web application behavior changes depending under what web site it is running. Is there a way for the web application to find out what is the name of the WebSit开发者_JS百科e under which it is handling the current request.

Thank you Imran


System.Web.Hosting.HostingEnvironment.SiteName

will get you the site name as it appears in IIS

Request.Url.Authority

will get yo the requesting url

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜