网上找了好多,包括改IE安全设置, 在webbrose里的网页加上代码<!-- saved from url=(0013)about:internet -->,都没有效果。

后来在MSDN上看到了解决办法。

 // Load HTML document as a stream
  Uri uri = new Uri(@"pack://application:,,,/HTMLDocumentWithScript.html", UriKind.Absolute);
  Stream source = Application.GetResourceStream(uri).Stream;
  // Navigate to HTML document stream
  this.webBrowser.NavigateToStream(source);

最后记得将相应的资源文件比如上面的HTMLDocumentWithScript.html 设置生成操作为resource !

相关文章:

  • 2021-11-21
  • 2022-01-16
  • 2022-12-23
  • 2022-02-08
  • 2021-07-16
  • 2021-09-10
  • 2021-12-04
猜你喜欢
  • 2021-08-11
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2021-12-08
  • 2021-12-23
相关资源
相似解决方案