繁体   English   中英

如何知道当前pc的外部ip地址

[英]How to know external ip adress of the current pc

例如,为了获取我使用的本地IP地址:

 string myHost = System.Net.Dns.GetHostName();
 string myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[0].ToString();

这是一个可能有用的链接。 http://www.dreamincode.net/forums/topic/24692-showing-the-external-ip-address-in-c%23/

关于向WhatIsMyIP.com进行网络请求的帖子很好

暂无
暂无

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

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