日期:2014-05-18 浏览次数:20601 次
string[] sentences = 
  {
   "你",
   "x"
   };
 bool find = false;
 string sPattern = this.content.Text;
 foreach (string s in sentences)
    {
    if (System.Text.RegularExpressions.Regex.IsMatch(sPattern,s))
    {
    //找到了
    }
    else
    {
    //没有找到
    }
FileStream fs = new FileStream(Server.MapPath(".")+"\\test1.txt",FileMode.Open,FileAccess.Read); 
    StreamReader sr = new StreamReader(fs); 
    string[] words= sr.ReadToEnd().Split('|'); 
 bool find = false;
 string sPattern = this.content.Text;
 foreach (string s in words)
    {
    if (System.Text.RegularExpressions.Regex.IsMatch(sPattern,s))
    {
    //找到了
    }
    else
    {
    //没有找到
    }