You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
688 B

  1. namespace Learun.Application.Web.Extensions
  2. {
  3. public class StrHelper
  4. {
  5. public static string DelErrChar(string str)
  6. {
  7. str = str.Trim().ToLower();
  8. if (string.IsNullOrEmpty(str))
  9. return string.Empty;
  10. string[] ErrStr = new string[] { "select", "update", "insert", "delete", "'", ";", ":", "@", "or", "and", "drop", "alter", "create", "exec" };
  11. for (int i = 0; i < ErrStr.Length; i++)
  12. {
  13. if (str.Contains(ErrStr[i]))
  14. {
  15. str = str.Replace(ErrStr[i], string.Empty);
  16. }
  17. }
  18. return str;
  19. }
  20. }
  21. }