devxlogo

July 18, 2019

Check Whether or Not an IP Is Valid in C#

See below for a short function that validates a given IP address: public static Boolean ValidateIP(string inputIP){var ipParts = inputIP.Split(‘.’);return Int32.Parse(ipParts [0]) < 256 &&Int32.Parse(ipParts [1]) < 256&Int32.Parse(ipParts [2]) <