Is Not Invalid Email - CSharp System.Text.RegularExpressions

CSharp examples for System.Text.RegularExpressions:Match Email

Description

Is Not Invalid Email

Demo Code


using System.Text.RegularExpressions;
using System;//w w  w.  jav  a  2 s. c om

public class Main{
        public static void IsNotInvalidEmail(string param, string name)
        {
            if (!String.IsNullOrEmpty(param) && !EmailExpression.IsMatch(param))
            {
                throw new ArgumentException(String.Format("\"{0}\" is not a valid email address.", name));
            }
        }
}

Related Tutorials