本文介绍了如何获取服务器IP地址(在C#/asp.net中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有1行方法来获取服务器的IP地址?
Is there a 1 line method to get the IP Address of the server?
谢谢
推荐答案
Request.ServerVariables["LOCAL_ADDR"];
从文档:
这不同于与客户端计算机有关的远程地址.
This is distinct from the Remote addresses which relate to the client machine.
这篇关于如何获取服务器IP地址(在C#/asp.net中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!