-2

我搜索谷歌,发现几行代码可以做到这一点。这是代码

using Microsoft.mshtml;
....
{
...
    // To Remove     
    HTMLDocumentClass htmldoc = wbCtrl.Document.DomDocument as HTMLDocumentClass;
    IHTMLDOMNode node = htmldoc.getElementById("xBar") as IHTMLDOMNode;
    node.parentNode.removeChild(node);
...
}

我收到 mshtml 参考错误,但我从这个路径C:\Program Files\Microsoft.NET\Primary Interop Assemblies 添加库并添加名为 Microsoft.mshtml.dll 的 dll

但仍然有错误。所以帮我添加什么,结果我可以使用上面的代码。我正在运行我的应用程序 VS2010 IDE。

4

1 回答 1

0

您最近问题的旧答案已重新发布,因为它适用:

//in class def
private bool firstTime;
//in method
bool firstTimeLcl = firstTime
firstTime = false;
if (firstTimeLcl)
{
//write header
} 
else
{
String.Replace(/*closing tags*/, "");
}
//write everything within body
//write closing tags
于 2013-02-18T14:21:44.640 回答