private bool FilterIllegalChar(string sWord) 
{
    var result = false;
    var keyWord = @"select|insert|delete|from|count\(|drop table|update|truncate|asc\(|mid\(|char\(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
    string StrRegex = @"[-|;|,|/|\(|\)|\[|\]|}|{|%|\@|*|!|']";
    if (Regex.IsMatch(sWord, keyWord, RegexOptions.IgnoreCase) || Regex.IsMatch(sWord, StrRegex))
        return true;

    return result;
}

 

相关文章:

  • 2022-02-10
  • 2021-11-05
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
猜你喜欢
  • 2021-09-17
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案