/// <summary>
/// 验证ip地址
/// </summary>
/// <param name="ipAddress"></param>
/// <returns></returns>
public static bool ValidateIPAddress(string ipAddress)
{
//https://blog.csdn.net/linxinfa/article/details/99306256
Regex validipregex = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$");
return (ipAddress != "" && validipregex.IsMatch(ipAddress.Trim())) ? true : false;
}