6

是否可以绕过“另存为”对话框保存任何类型的文件?使用 WebBrowser 类

WebBrowser.ShowSaveAsDialog();

WebBrowser 控件中加载的内容是否可序列化,以便可以保存和检索(用于重新显示)?

4

2 回答 2

2

Given that you have full access to the DOM and can therefore read any contents that the WebBrowser is displaying the answer must be yes.

  • Using the tree of DOM nodes read the contents of the WebBrowser into the C# world
  • Write to the file using normal .NET file access

However if you just wish to download a webpage and save it to disk there are better ways then using the WebBrowser control, have a look at the WebClient class

于 2009-10-15T15:47:54.123 回答
0

我看到这是一个老问题,但我只是要更新一个可能的替代方案。

请查看此 CodeProject 文章

于 2011-09-28T16:37:40.610 回答