C#替换特殊字符防SQL注入
//删除与数据库相关的词 str = Regex.Replace(str, "select", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, "insert", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, "delete from", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, "count", "", RegexOptions.IgnoreCase);