dcsimg
 

Submitted by: Srinath M S(srinath_ms@yahoo.com)

Thursday Jul 18th 2019 by Srinath M S

Language: .NET, Expertise: Beginner - Learn more about a short function that validates a given IP address.

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]) < 256 &

Int32.Parse(ipParts [3]) < 256;

}
Home
Mobile Site | Full Site