To Clear Special Characters
public static string FormatTextForInput(string Text)
{
if (Text == "")
return "";
if (Text == null)
return "";
string output = Text;
//Build an array of characters that need to be filter.
string[] strDirtyInput = { "xp_", ";", "--", "<", ">", "iframe", "script","#","!","#","^","&","*","~","%","$","@" };
//Loop through all items in the array
foreach (string item in strDirtyInput)
{
output = output.Replace(item, "");
}
output = output.Replace("'", "''");
return output;
}
0 comments:
Post a Comment