How to convert an IPv4 address into a integer in C#?

32-bit unsigned integers are IPv4 addresses. Meanwhile, the IPAddress.Address property, while deprecated, is an Int64 that returns the unsigned 32-bit value of the IPv4 address (the catch is, it’s in network byte order, so you need to swap it around). For example, my local google.com is at 64.233.187.99. That’s equivalent to: 64*2^24 + 233*2^16 + … Read more