如何在C#中的表单应用中获取外部IP [英] How to get external IP in forms app inC#

查看:48
本文介绍了如何在C#中的表单应用中获取外部IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取用C#编码的Windows Forms应用程序用户的外部IP我尝试了很多东西,但是每个代码都给出了内部IP,即192.168.1.1,任何帮助都会受到赞赏

I want to fetch external IP of the user of my Windows Forms Application coded in C# I've tried many things but every code gives out internal IP i.e 192.168.1.1 any help would be appreciated

推荐答案

使用 http://checkip.dyndns.org/ 尝试以下链接中提到的一些技巧[ ^ ]



http://stackoverflow.com/questions/3253701/c-sharp -get-public-external-ip-address / 12659299 [ ^ ]
Try some tricks mentioned in the below link , using http://checkip.dyndns.org/[^]

http://stackoverflow.com/questions/3253701/c-sharp-get-public-external-ip-address/12659299[^]


这看起来也是一个很好的解决方案。



STUN Client [ ^ ]
This looks like a good solution, too.

STUN Client[^]


这篇关于如何在C#中的表单应用中获取外部IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆