/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public bool InvalidChars(string sInput) { bool functionReturnValue = false; //Declare variables object sBadChars; object iCounter; //Set functionReturnValue to False functionReturnValue = false; //Create an array of invalid characters and words sBadChars = array("select", "drop", ";", "--", "insert", "delete", "xp_", "#", "%", "&", "'", "(", ")", "/", "\\", ":", ";", "<", ">", "=", "[", "]", "?", "`", "|"); //Loop through array sBadChars using our counter & UBound function for (iCounter = 0; iCounter <= Information.uBound(sBadChars); iCounter++) { //Use Function Instr to check presence of illegal character in our variable if (Strings.Instr(sInput, sBadChars(iCounter)) > 0) { functionReturnValue = true; } } return functionReturnValue; }