乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      C#去除字符串中的HTML,效果就像將HTML復(fù)制到記事本一樣

       NaturalWill 2014-04-18
      1. /// <summary>  
      2.         /// 去除字符串中的HTML,效果就像將HTML復(fù)制到記事本一樣  
      3.         /// </summary>  
      4.         /// <param name="Htmlstring"></param>  
      5.         /// <returns></returns>  
      6.         public static string DelHTML(string Htmlstring)//將HTML去除  
      7.         {  
      8.             #region  
      9.             //刪除腳本  
      10.   
      11.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      12.   
      13.             //刪除HTML  
      14.   
      15.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"<(.[^>]*)>", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      16.   
      17.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"([/r/n])[/s]+", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      18.   
      19.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"-->", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      20.   
      21.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"<!--.*", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      22.   
      23.             //Htmlstring =System.Text.RegularExpressions. Regex.Replace(Htmlstring,@"<A>.*</A>","");  
      24.   
      25.             //Htmlstring =System.Text.RegularExpressions. Regex.Replace(Htmlstring,@"<[a-zA-Z]*=/.[a-zA-Z]*/?[a-zA-Z]+=/d&/w=%[a-zA-Z]*|[A-Z0-9]","");  
      26.   
      27.   
      28.   
      29.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(quot|#34);", "/"", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      30.   
      31.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(amp|#38);", "&", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      32.   
      33.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(lt|#60);", "<", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      34.   
      35.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(gt|#62);", ">", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      36.   
      37.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(nbsp|#160);", " ", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      38.   
      39.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(iexcl|#161);", "/xa1", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      40.   
      41.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(cent|#162);", "/xa2", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      42.   
      43.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(pound|#163);", "/xa3", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      44.   
      45.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&(copy|#169);", "/xa9", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      46.   
      47.             Htmlstring = System.Text.RegularExpressions.Regex.Replace(Htmlstring, @"&#(/d+);", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);  
      48.   
      49.   
      50.             Htmlstring.Replace("<", "");  
      51.   
      52.             Htmlstring.Replace(">", "");  
      53.   
      54.             Htmlstring.Replace("/r/n", "");  
      55.   
      56.             //Htmlstring=HttpContext.Current.Server.HtmlEncode(Htmlstring).Trim();  
      57.             #endregion  
      58.   
      59.   
      60.             return Htmlstring;  
      61.   
      62.         }  

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約