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
659 B
C#

4 months ago
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)
{
3 months ago
string[] sqlCheckList = { "TRUNCATE", "INSERT", "UPDATE", "DELETE", "DROP", "--"};
4 months ago
foreach (string item in sqlCheckList)
{
if (input.IndexOf(item, StringComparison.OrdinalIgnoreCase) >= 0)
{
return true;
}
}
return false;
}
}
}