国产探花免费观看_亚洲丰满少妇自慰呻吟_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;

  }

}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 全南县| 阳原县| 涟水县| 张北县| 扬中市| 兴海县| 得荣县| 梅河口市| 隆德县| 水城县| 察雅县| 玉门市| 广河县| 漯河市| 鹤峰县| 梧州市| 神农架林区| 陇川县| 清丰县| 视频| 平江县| 崇信县| 农安县| 萝北县| 安康市| 武城县| 监利县| 类乌齐县| 舟曲县| 达州市| 渝中区| 许昌县| 微山县| 平谷区| 亚东县| 广丰县| 柞水县| 竹山县| 隆回县| 巴南区| 宁安市|