views:

662

answers:

2

Is it possible to save a file of any type bypassing the 'save as' dialog? using the WebBrowser Class

WebBrowser.ShowSaveAsDialog();

Is the loaded content in a Webbrowser control serializable so it can be saved and retrieved (for redisplay)?

+1  A: 

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

Ian Ringrose
A: 

I looked for DAYS for this! Most had code a mile long... this is short, to the point, and works like a dream!!!

Thank YOU!!!

Jim Davis