如何编码以查找网络中连接的系统的IP地址 [英] How Do I code to find the IP address of the systems conneted in my network

查看:78
本文介绍了如何编码以查找网络中连接的系统的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我这样做。我是c#编码的初学者

please help me to do this. I am a beginner in c# coding

推荐答案

希望这会有效,

Hope this would work,
foreach (NetworkInterface netif in NetworkInterface.GetAllNetworkInterfaces())
{
    IPInterfaceProperties properties = netif.GetIPProperties();
    foreach (IPAddressInformation unicast in properties.UnicastAddresses)
    {
           Console.Writeline(unicast.Address);
    }
}





或者看这里,

如何获取机器的IP地址 [ ^ ]



-KR



or look at here,
How To Get IP Address Of A Machine[^]

-KR


这篇关于如何编码以查找网络中连接的系统的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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