我想收杆一个HTML字符串,如:C#帕尔斯HTML字符串标记文本
<b><a href="/wiki/Schizophrenie" title="Schizophrenie">Schizophrenie</a></b> ist eine schwere psychische Erkrankung. Sie
或
<h2 class="sectionedit2" id="zu_treffende_massnahmen">zu treffende Maßnahmen</h2>
<div class="level2">
<ul><li class="level1"><div class="li">An- und Abfahrtswege freihalten; Einweisung nachrückender Kräfte, evtl. Einbahnregelung vorsehen</div>
,使所有的文本得到一些额外的字体样式元素(<font style = "color:red;">..</font>
),如:
<b><a href="/wiki/Schizophrenie" title="Schizophrenie"><font style = "color:red;">Schizophrenie</font></a></b><font style = "color:red;"> ist eine schwere psychische Erkrankung. Sie</font>
或
<h2 class="sectionedit2" id="zu_treffende_massnahmen"><font style = "color:red;">zu treffende Maßnahmen</font></h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"><font style = "color:red;"> An- und Abfahrtswege freihalten; Einweisung nachrückender Kräfte, evtl. Einbahnregelung vorsehen</font></div>
有没有简单的方法来做到这一点?
使用http://htmlagilitypack.codeplex.com/ – EricLaw 2013-04-24 21:51:14