I believe that you can use System.Net.IPAddress to also represent the subnet mask. This is the same form, and the only real operation you need to perform is a bitmask based on bytes of the subnet address.
System.Net.IPAddress i = System.Net.IPAddress.TryParse("10.10.1.1");
Byte[] b = i.GetAddressBytes();
source
share