コード例 #1
0
 public static int SubnetMaskToInt(IPAddress ip)
 {
     return SubnetMaskToInt((uint)ip.ToInt());
 }
コード例 #2
0
        public IPGroup GetIPGroup(IPAddress ip)
        {
            var ipGroup = db.IPGroups.AsEnumerable().SingleOrDefault(x =>
                (new IPAddress(x.SubnetMask.Address).ToInt() & ip.ToInt()) ==
                (new IPAddress(x.IP.Address).ToInt() & new IPAddress(x.SubnetMask.Address).ToInt()));

            return ipGroup;
        }