check validity of IP address
Published: 22. January 2009 | Updated: 22. January 2009License: Microsoft Public License (MS-PL)
Categories: Network
Tags: C# Network
Import namespace
using System.Net;
Code
string ipAddress = "10.20.30.40"; IPAddress ipObj = null; if (IPAddress.TryParse(ipAddress, out ipObj)) { Console.WriteLine("IP {0} is valid", ipObj); }
| Send us feedback about this snippet » |





