Anti-SQL injection function parameter passing

        bool CheckParams(string args)
        {
            string[] Lawlesses ={ "'", "xp_cmdshell", "net user", "exec", "insert", "select", "delete", "update", "count", "master", "truncate", "char", "declare" };
            for (int i = 0; i < Lawlesses.Length; i++)
            {
                Regex r = new Regex(Lawlesses[i]);
                Match m = r.Match(args);
                if (m.Success)
                    return false;
            }
            return true;
        }

Reproduced in: https: //www.cnblogs.com/guoxiaowen/archive/2011/09/27/2193018.html

Guess you like

Origin blog.csdn.net/weixin_34143774/article/details/93697794