【发布时间】:2012-03-07 21:11:09
【问题描述】:
我正在使用 HTML Agility Pack,并且我正在尝试替换一些这样的标签的 InnerText
protected void GerarHtml()
{
List<string> labels = new List<string>();
string patch = @"C:\EmailsMKT\" +
Convert.ToString(Session["ssnFileName"]) + ".html";
DocHtml.Load(patch);
//var titulos = DocHtml.DocumentNode.SelectNodes("//*[@class='lblmkt']");
foreach (HtmlNode titulo in
DocHtml.DocumentNode.SelectNodes("//*[@class='lblmkt']"))
{
titulo.InnerText.Replace("test", lbltitulo1.Text);
}
DocHtml.Save(patch);
}
html:
<.div><.label id="titulo1" class="lblmkt">teste</label.><./Div>
【问题讨论】:
标签: c# html html-agility-pack