Now online relatively large forums have to record, once there is any unreasonable information, may be affected by the Department of that what ... So in the information filtering seems to have a bit of status. below to introduce a simple information hard filtering method. is actually automatic matching. The code is as follows: public void Checkwords (String str)
{
Create an array to write the string to filter
String[] Badwords=new string[2];
Badwords[0]= "C";
badwords[1]= ". NET";
System.Text.RegularExpressions.Regex re;
for (int i=0;i<2;i++)//a loop check to see if a predetermined string is included
{
Re=new System.Text.RegularExpressions.Regex (Badwords[i]);
if (re. Match (str). Success)
{
Response.Write ("Capture to a predetermined information:");
Response.Write (Badwords[i]);
Response.Write ("<br>");
}
}
}
When used, the code is
String str= "C#.net";
Checkwords (str);
We can according to this example, free play, should be able to make better information filter things to.
In the analysis of information filtering, we can also consider using it to retrieve information, or other uses. I hope you can gain something. I have a limited level, and you are welcome to criticize.