Пример #1
0
 private void init(SubnetMask mask)
 {
     this.mask = mask;
     byte[] networkBytes = Utils.GetBytes(Utils.GetNetworkBits(this.GetAddressBits(), mask.NetworkPrefixLength));
     this.network = new NetworkAddress(
         new IPAddress(networkBytes),
         mask
         );
 }
Пример #2
0
 public NetworkAddress(IPAddress ipaddress, SubnetMask subnetMask) : base(ipaddress, subnetMask)
 {
     init();
 }
Пример #3
0
 public SubnetIpAddress(IPAddress ipaddress, SubnetMask subnetMask) : base(ipaddress.GetAddressBytes())
 {
     init(subnetMask);
 }
Пример #4
0
 public SubnetIpAddress(byte[] address, long scopeid) : base(address, scopeid)
 {
     init(SubnetMask.GetDefaultValue(this.AddressFamily));
 }
Пример #5
0
 public SubnetIpAddress(long newAddress) : base(newAddress)
 {
     init(SubnetMask.GetDefaultValue(this.AddressFamily));
 }
Пример #6
0
 public static bool IsInSameSubnet(IPAddress reference, IPAddress comparison, SubnetMask subnetMask)
 {
     return(IsInSameSubnet(new SubnetIpAddress(reference, subnetMask), comparison));
 }