1// method to Check for AlphaNumeric. 2 public bool IsAlphaNumeric(string strToCheck) 3 { 4 Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9]"); 5 return !objAlphaNumericPattern.IsMatch(strToCheck); 6 }