好垃圾
为什么提示只能有3次回复?限制太多真的很恶心。另外,还不让编辑自己发的帖子。晕死!回复之前那个自己的帖子:
按照你的方法代码如下:
webBrowser2.Document.Body.OuterHtml = webBrowser2.Document.Body.OuterHtml.Replace("<","<").Replace(">",">");
运行后提示:
NotSupportedException
反编译了下代码:
// System.Windows.Forms.HtmlElement
public string OuterHtml
{
get
{
return this.NativeHtmlElement.GetOuterHTML();
}
set
{
try
{
this.NativeHtmlElement.SetOuterHTML(value);
}
catch (COMException ex)
{
if (ex.ErrorCode == -2146827688)
{
throw new NotSupportedException(SR.GetString("HtmlElementPropertyNotSupported"));
}
throw;
}
}
}
说明set操作是不安全可靠的。
也许要获取DomDocument再操作?毕竟对webbrowser菜单操作显示正确的源码。 webbrowser html DomDocument --------------------编程问答--------------------
补充:.NET技术 , C#