#region 过滤sql关键字
/// <summary>
/// 过滤sql关键字
/// </summary>
/// <param name="InText"></param>
/// <returns></returns>
public static bool SqlFilter(string InText)
{
string word = "and|exec|insert|select|delete|update|chr|mid|master|or|truncate|char|declare|join|drop|where|1=1|into|%|&";
if (InText == null)
return false;
foreach (string str_t in word.Split('|'))
{
if (string.Equals(InText, str_t, StringComparison.CurrentCultureIgnoreCase))
return true;
if ((InText.ToLower().IndexOf(str_t + " ") > -1) || (InText.ToLower().IndexOf(" " + str_t) > -1) || (InText.ToLower().IndexOf(" " + str_t + " ") > -1))
{
return true;
}
}
return false;
}
#endregion