日期:2014-05-16 浏览次数:20436 次
public static SqlConnection GreatConn()//创建数据库链接
{
string ss1 = "and,exec,insert,select,delete,update,count,chr,mid,master,truncate,char,declare";
String[] sArray = ss1.Split(',');
for (int i = 0; i < sArray.Length - 1; i++)
{
foreach (string tempLoopVar_SQL_Get in System.Web.HttpContext.Current.Request.QueryString)
{
string SQL_Get = tempLoopVar_SQL_Get;
if (System.Web.HttpContext.Current.Request.QueryString[SQL_Get].Contains(sArray[i]) == true)
{
System.Web.HttpContext.Current.Response.Write("请不要尝试进行SQL注入!");
System.Web.HttpContext.Current.Response.End();
}
}
foreach (string tempLoopVar_Sql_Post in System.Web.HttpContext.Current.Request.Form)
{
string Sql_Post = tempLoopVar_Sql_Post;
if (System.Web.HttpContext.Current.Request.Form[Sql_Post].Contains(sArray[i]) == true)
{
System.Web.HttpContext.Current.Response.Write("请不要尝试进行SQL注入!");
System.Web.HttpContext.Current.Response.End();
&nb