You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
665 B
C#

using System;
namespace DS.WMS.PrintApi.Utils
{
public static class SqlUtil
{
/// <summary>
/// sql
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static bool IsSqlInjection(string input)
{
string[] sqlCheckList = { "TRUNCATE", "INSERT", "UPDATE", "DELETE", "DROP", "--", "'" };
foreach (string item in sqlCheckList)
{
if (input.IndexOf(item, StringComparison.OrdinalIgnoreCase) >= 0)
{
return true;
}
}
return false;
}
}
}