请救:C# 有可以使用校验的类吗?如何使用?
在C#中,如何能像在vb.net那样,轻松自如的验证文本内容是否符合某格式   或是   验证email格式?
------解决方案--------------------using System.Runtime.InteropServices;   
 Regex.IsMatch(textBox1.Text, @ "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* ");
------解决方案--------------------自己写了效验输入字符的方法,你看看是否可以帮的上忙。 
 //智能匹配部分编写开始---------------------- 
 ///  <summary>  
 /// 智能匹配  
 ///  </summary>  
 ///  <param name= "inputString "> 操作时输入的字段,需要把它与数据库里的数据进行智能匹配 </param>  
 ///  <param name= "dbTable "> 需要访问的数据库里的表 </param>  
 ///  <param name= "identifyingKeyCount "> 要返回dbTable里的相关识别主键字段数量 </param>  
 ///  <param name= "identifyingFieldAry "> 要返回dbTable里的相关字段数组 </param>  
 ///  <param name= "matchField "> dbTable里要进行匹配的数据字段 </param>  
 ///  <returns> datatable类型,包含3个字段identifyingField,matchField,matchNumber,前台可以让之直接与DropdownList进行绑定,可以对该表的dataview进行fliter操作,按matchNumber进行倒序排列 </returns>  
 public DataTable intelligenceMatch(string inputString,string dbTable,string[] identifyingFieldAry,string matchField) 
 	{ 
 		DataTable idt; 
 		//检查分析inputString 
 		//作为区域划分的字符 
 		char[] nullityChar=new char[] { '( ', ') ', '( ', ') ', ' < ', '>  ', '〈 ', '〉 ', '{ ', '} ', '{ ', '} ', '[ ', '] ', '[ ', '] ', '《 ', '》 ', '【 ', '】 ', '〖 ', '〗 '}; 
 		string tempName=inputString.Trim().Replace( "  ", " ").Replace( "   ", " ");    //检查字符 
 		for(int ig=0;ig <ignoreMatch.Length;ig++){ 
 				tempName=tempName.Replace(ignoreMatch[ig], " ");                       //过滤Web.Config中设定的过滤字段 
 			} 
 			ArrayList tempNameAryList=new ArrayList();                               //有效双字段 
 			ArrayList tempCharAryList=new ArrayList();                               //有效但字段 
 			// 
 			if(tempName!= " ") 
 			{ 
 				//按双字划分,去除无效字段 
 				string[] tempNameAry=tempName.Split(nullityChar); 
 				for(int i=0;i <tempNameAry.Length;i++) 
 				{ 
 					for(int j=0;j <tempNameAry[i].Length;j++) 
 					{ 
 						//检查数据库中含有该字段的数量,并记录下来。 
 						string tempDoubleChar=(tempNameAry[i]+ "   ").ToString().Substring(j,2).Trim(); 
 						if(tempDoubleChar.Length==2)tempNameAryList.Add(tempDoubleChar); 
 					} 
 				} 
 				//对数据库进行查询操作,判定各字段的出现几率,将出现值超过预期值的字段去除 
 			}			 
 			if(dbConn.State.ToString()== "Closed ")dbConn.Open(); 
 			for(int tempi=0;tempi <tempNameAryList.Count;tempi++){ 
 				SqlCommand scmd=new SqlCommand( "select Count(*) as CountNumber from  "+dbTable+ " where  "+matchField+ " like  '% "+tempNameAryList[tempi]+ "% ' ",dbConn); 
 				SqlDataReader ssdr=scmd.ExecuteReader(); 
 				if(ssdr.Read()) 
 				{ 
 					if(int.Parse(ssdr[ "CountNumber "].ToString())> 5)tempName.Replace(tempNameAryList[tempi].ToString(), " "); 
 				} 
 				ssdr.Close(); 
 			} 
 			//去除括号,剩余有效字段 
 			for(int nulli=0;nulli <nullityChar.Length;nulli++){ 
 				tempName=tempName.Replace(nullityChar[nulli].ToString(), " "); 
 			} 
 			//形成单字集合 
 			string andSql= " "; 
 			for(int l=0;l <tempName.Length;l++){ 
 				tempCharAryList.Add(tempName.Substring(l,1)); 
 				andSql+= " and  "+matchField+ " like  '% "+tempName.Substring(l,1)+ "% '  "; 
 			} 
 			//进行and匹配