1 public static bool IsValidIp(string strIn) 2 { 3 bool b = Regex.IsMatch(strIn, @"^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"); 4 5 return b; 6 }
1 public static bool IsValidIp(string strIn) 2 { 3 bool b = Regex.IsMatch(strIn, @"^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"); 4 5 return b; 6 }
原文:https://www.cnblogs.com/dotnetHui/p/8529078.html