zoukankan      html  css  js  c++  java
  • C#程序中防SQL注入的简单字符串替换

    Acc = Acc.Replace("[", "……");

    Acc = Acc.Replace("]", "……");

    Acc = Acc.Replace("and", "");

    Acc = Acc.Replace("=", "{");

    Acc = Acc.Replace("<", "}");

    Acc = Acc.Replace(">", "}");

    Acc = Acc.Replace(";", ":");

    Acc = Acc.Replace("'", "’");

    Acc = Acc.Replace("&", "’");

    Acc = Acc.Replace("'", "’");

    Acc = Acc.Replace("--", "’");

    Acc = Acc.Replace("==", "’");

    Acc = Acc.Replace("'", "’");

    Acc = Acc.Replace("'", "’");

    Acc = Acc.Replace("/", "");

    Acc = Acc.Replace("script", "");

    Acc = Acc.Replace("SCRIPT", "‘");

    Acc = Acc.Replace("Script", "’");

    Acc = Acc.Replace("script", "’");

    Acc = Acc.Replace("object", "’");

    Acc = Acc.Replace("OBJECT", "’");

    Acc = Acc.Replace("Object", "’");

    Acc = Acc.Replace("object", "’");

    Acc = Acc.Replace("applet", "’");

    Acc = Acc.Replace("APPLET", "’");

    Acc = Acc.Replace("Applet", "’");

    Acc = Acc.Replace("applet", "’");

    Acc = Acc.Replace("select", "’");

    Acc = Acc.Replace("execute", "’"); 

    Acc = Acc.Replace("exec", "’");

    Acc = Acc.Replace("join", "’");

    Acc = Acc.Replace("union", "’");

    Acc = Acc.Replace("where", "’");

    Acc = Acc.Replace("insert", "’");

    Acc = Acc.Replace("delete", "’");

    Acc = Acc.Replace("update", "’");

    Acc = Acc.Replace("like", "’");

    Acc = Acc.Replace("drop", "’");

    Acc = Acc.Replace("create", "’");

    Acc = Acc.Replace("rename", "’");

    Acc = Acc.Replace("count", "’");

    Acc = Acc.Replace("chr", "’");

    Acc = Acc.Replace("mid", "’");

    Acc = Acc.Replace("truncate", "’");

    Acc = Acc.Replace("nchar", "’");

    Acc = Acc.Replace("char", "’");            

    Acc = Acc.Replace("alter", "z");            

    Acc = Acc.Replace("cast", "z");            

    Acc = Acc.Replace("exists", "z");

  • 相关阅读:
    数据库分页
    oracle查询某一个字段的数量总和
    JSON.stringify()和JSON.parse()
    oracle查询以当前年份为准的近些年数据
    关于oracle中日期使用
    最简单的js确认框!
    oracle插入数据时解决和旧数据id的冲突
    CentOS查看内核版本,位数,版本号
    CentOS 使用命令设置代理
    CentOS 编译源码安装MySQL-5.6.16
  • 原文地址:https://www.cnblogs.com/huyueping/p/3101455.html
Copyright © 2011-2022 走看看