如何获得调制解调器的静态IP地址? [英] How to get modem's static IP address?
本文介绍了如何获得调制解调器的静态IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个用于调制解调器的静态IP地址.我需要使用C#代码获取调制解调器的IP地址吗?您有什么想法可以帮我吗?
预先感谢,
Saranya1388
Hi,
I have a static IP address for a modem. I need to get the IP address of the modem using C# code? Can you help me by giving any ideas?
Thanks in advance,
Saranya1388
推荐答案
也许这些答案之一可以 ^ ].
Maybe one of these answers can help[^].
您是否尝试过与此
have you tried with this
var name = Dns.GetHostName();
var entry = Dns.GetHostEntry(name);
foreach (var address in entry.AddressList) {
Console.WriteLine(address);
}
如果您仍然不确定,也可以对此进行了解
If still you are not convinces then have a look onto this as well
string ip = System.Net.WebClient.DownloadString("http://whatismyip.org/");
这篇关于如何获得调制解调器的静态IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文