敏感词匹配

 1                     string[] strs2 = File.ReadAllLines(System.AppDomain.CurrentDomain.BaseDirectory + @"Files\Cache\SensitiveWords.txt", Encoding.UTF8);
 2                     List<string> sensitiveWords = new List<string>(strs2);
 3                     bool havaSensitiveWord = false;
 4                     foreach (string str in sensitiveWords)
 5                     {
 6                         if (progress_content.Contains(str))
 7                         {
 8                             havaSensitiveWord = true;
 9                             break;//只要包含一个,跳出foreach循环
10                         }
11                     }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-15
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案