Yesterday in the company's website to see the Product Details page, found that only a company's JS product rotation effect will not be out, find a half-day, the program is the same, why? The original is the company alias is XIANDAHG, which contains and characters are filtered out.
public static string nohtml (String htmlstring)//Remove HTML tag
{
Delete Script
htmlstring = Regex.Replace (htmlstring, @ "<script[^>]*?>.*?</script>", "", regexoptions.ignorecase);
Delete HTML
htmlstring = Regex.Replace (htmlstring, @ "< (. [ ^>]*) > "," ", regexoptions.ignorecase);
htmlstring = Regex.Replace (htmlstring, @ "([\ r \ n]) [\s]+", "", regexoptions.ignorecase);
htmlstring = Regex.Replace (htmlstring, @ "-and", "", regexoptions.ignorecase);
htmlstring = Regex.Replace (htmlstring, @ "<!--. *", "", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (quot| #34);", "\" ", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (amp| #38);", "&", Regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (lt| #60);", "<", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (gt| #62);", ">", Regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (nbsp| #160);", "", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (iexcl| #161);", "\xa1", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (cent| #162);", "\xa2", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (pound| #163);", "\xa3", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "& (copy| #169);", "\xa9", regexoptions.ignorecase);
Htmlstring = Regex.Replace (htmlstring, @ "(\d+);", "", regexoptions.ignorecase);
Htmlstring.replace ("<", "");
Htmlstring.replace (">", "");
Htmlstring.replace ("\ r \ n", "");
htmlstring = Htmlstring.replace ("[\\s]{2,{", "" ");
htmlstring = Htmlstring.replace ("(<[b| b][r| r]/*>) +| (<[p| P] (. | \\n) *?>) "," \ n "); <br>
htmlstring = Htmlstring.replace ("(\\s*&[n| n][b| b][s| s][p| p];\\s*) + "," ");
htmlstring = Htmlstring.replace ("< (. | \\n) *?> ", String. Empty); Any other tags
htmlstring = Htmlstring.replace ("", " ");
htmlstring = Htmlstring.replace (" ", "");
htmlstring = Htmlstring.replace ("\ r \ n", "<br>");
htmlstring = htmlstring.replace ("=", "");
htmlstring = htmlstring.replace ("%", "");
htmlstring = Htmlstring.replace ("'", "" ");
htmlstring = Htmlstring.replace ("Select", "");
htmlstring = Htmlstring.replace ("Insert", "");
htmlstring = htmlstring.replace ("delete", "");
htmlstring = Htmlstring.replace ("or", "");
htmlstring = Htmlstring.replace ("exec", "");
htmlstring = Htmlstring.replace ("--", "" ");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("where", "");
htmlstring = Htmlstring.replace ("Update", "");
htmlstring = Htmlstring.replace ("Script", "");
htmlstring = Htmlstring.replace ("iframe", "");
htmlstring = Htmlstring.replace ("Master", "");
htmlstring = Htmlstring.replace ("exec", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("and", "");
htmlstring = Htmlstring.replace ("exists", "" ");
htmlstring = Htmlstring.replace ("Drop", "");
htmlstring = Htmlstring.replace ("996008E", "");
htmlstring = Htmlstring.replace ("AR (124)", "");
htmlstring = Htmlstring.replace ("1and", "");
htmlstring = Htmlstring.replace ("0and", "");
htmlstring = Htmlstring.replace ("Chr", "" ");
htmlstring = HttpContext.Current.Server.HtmlEncode (htmlstring). Trim ();
return htmlstring;
}
Ways to filter HTML characters