简体   繁体   English

如何获取服务器的IP地址?

[英]How to get ip address of the server?

how can I get the ip address of the IIS box where an asp.net application is running on? 如何获取运行asp.net应用程序的IIS框的ip地址? I tried: 我试过了:

 HttpContext.Current.Request.ServerVariables["SERVER_NAME"];

Is this at all possible? 这是可能吗?

Here are all the variables: 是所有变量:

HttpContext.Current.Request.UserHostAddress; should work

Link 1 链接1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM