2007年7月12日

C#判断IP地址是否合法函数-使用正则表达式-2个

摘要: public bool IsCorrenctIP(string ip){ string pattrn=@"(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])";if(System.Text.RegularExpressions.Regex.IsMatch(ip,pattrn)) { return true; }else{return false; }}publ 阅读全文

posted @ 2007-07-12 15:24 风灵溪清 阅读(246) 评论(0) 推荐(0) 编辑

导航