I have these codes below where it can identify the bad words (those words are stored in the database) you've entered with the Web Browser Control and turn it into asterisk (*). I have been struggling with case sensitive in which you can enter either lower case or upper case (example: HeLlo)
string query;
query = @"select Word from ListWords";
List<string> words = new List<string>();
DataSet ds;
DataRow drow;
ds = DatabaseConnection.Connection1(query);
int index, total;
total = ds.Tables[0].Rows.Count;
string current_word;
for (index = 0; index < total; index++ )
{
drow = ds.Tables[0].Rows[index];
current_word = drow.ItemArray.GetValue(0).ToString();
words.Add(current_word);
}
Console.WriteLine(query);
Console.WriteLine("array:" + words);
foreach (String key in words)
{
String substitution = "<span style='background-color: rgb(255, 0, 0);'>" + key + "</span>";
int len = key.Length;
string replace = "";
for ( index = 0; index < len; index++)
{
replace += "*";
}
html.Replace(key, replace);
//count++;
}
doc2.body.innerHTML = html.ToString();
}