开发者

How can I check that I run the application on my server means localhost:portnumber or hosted them on the internet

I have a MVC application; in deve开发者_运维技巧lopment machine the debug path goes something like localhost:.

I can check that url of the request my server have is localhost or application hosted on server means they are online.

How can I find out that my application is on development machine?


HttpRequest.IsLocal


Check Request.Url.Hostname and Request.Url.Port.
This will tell you the URL that the user requested.

Alternatively, check Environment.MachineName.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜