Regex HelperIs Ip Address 方法
验证字符串是否为有效的 IP 地址格式(简单模式,不验数值范围)。
Definition
命名空间: Suresking.Utility
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
如果格式符合 IP 地址模式,返回 true;否则返回 false。
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
C#
public static bool IsIpAddress(
string input
)参数
- input String
- 要验证的字符串。
返回值
Boolean如果格式符合 IP 地址模式,返回 true;否则返回 false。
备注
此方法仅验格式,999.999.999.999 也会返回 true。
严格 IPv4 验证请用 IsValidIpv4(String)。
异常
| ArgumentNullException | input 为 null。 |