国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

.net 過濾特殊字符

2019-11-17 02:07:56
字體:
來源:轉載
供稿:網友

.net 過濾特殊字符

/// <summary> /// 過濾標記 /// </summary> /// <param name="NoHTML">包括HTML,腳本,數據庫關鍵字,特殊字符的源碼 </param> /// <returns>已經去除標記后的文字</returns> public string NoHTML(string Htmlstring) {   if (Htmlstring == null)   {     return "";   }   else   {     //刪除腳本     Htmlstring = Regex.Replace(Htmlstring, @"<scr

    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 = Regex.Replace(Htmlstring, "xp_cmdshell", "", RegexOptions.IgnoreCase);

    //刪除與數據庫相關的詞     Htmlstring = Regex.Replace(Htmlstring, "select", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "insert", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "delete from", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "count''", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "drop table", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "truncate", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "asc", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "mid", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "char", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "xp_cmdshell", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "exec master", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "net localgroup administrators", "", RegexOptions.IgnoreCase);     Htmlstring = Regex.Replace(Htmlstring, "and", "", RegexOptions.IgnoreCase);

    return Htmlstring;

  }

}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鹤峰县| 克东县| 南平市| 灌南县| 漾濞| 沁源县| 福建省| 施甸县| 东源县| 于田县| 肃北| 鄂托克旗| 随州市| 安丘市| 麻城市| 来凤县| 克什克腾旗| 和龙市| 乌兰察布市| 酒泉市| 荆州市| 富锦市| 吉隆县| 吉林市| 浮山县| 孝昌县| 商河县| 鄢陵县| 都兰县| 城步| 迭部县| 元阳县| 罗平县| 信阳市| 观塘区| 桑植县| 洛隆县| 和田县| 璧山县| 波密县| 醴陵市|