c#怎样判断email格式输入正确 --适用winform

用正则表达式: 
bool IsValidEmail(string strIn) 

// Return true if strIn is in valid e-mail format. 
return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"); 
}

posted @ 2008-12-23 17:02  Nina  阅读(775)  评论(0编辑  收藏  举报