在cs文件里,写一个方法:如下
//传入一个参数,判断是否数字
public bool IsValidEmail(string emal)
{
return System.Text.RegularExpressions.Regex.IsMatch(emal, @"/w+([-+.]/w+)*@/w+([-.]/+)*/./w+([-.]/w+)*");
}
要注意的是要加@否则可能会报错
在cs文件里,写一个方法:如下
//传入一个参数,判断是否数字
public bool IsValidEmail(string emal)
{
return System.Text.RegularExpressions.Regex.IsMatch(emal, @"/w+([-+.]/w+)*@/w+([-.]/+)*/./w+([-.]/w+)*");
}
要注意的是要加@否则可能会报错