コード例 #1
0
        public static NCIInfo GetNICInfo(string MAC)
        {
            List <NCIInfo> ips = NetworkCardInterface.GetNCIInfoList();

            foreach (NCIInfo ip in ips)
            {
                if (ip.MAC == MAC)
                {
                    return(ip);
                }
            }

            return(null);
        }
コード例 #2
0
        public static IPAddress GetIPAddress(string MAC)
        {
            List <NCIInfo> ips = NetworkCardInterface.GetNCIInfoList();

            foreach (NCIInfo ip in ips)
            {
                if (ip.MAC == MAC)
                {
                    return(ip.Address);
                }
            }

            return(null);
        }
コード例 #3
0
        public static List <NCIInfo> GetNICInfo(NCIType type)
        {
            List <NCIInfo> ret = new List <NCIInfo>();
            List <NCIInfo> ips = NetworkCardInterface.GetNCIInfoList();

            foreach (NCIInfo ip in ips)
            {
                if ((type & ip.Type) != 0)
                {
                    ret.Add(ip);
                }
            }
            return(ret);
        }