Re: Invoke 'Save As' Dialog to save WebBrowser control contents

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Tue, 22 Jan 2008 23:29:03 -0800, Shug <enoesque73@xxxxxxxxxxx> wrote:

I looked briefly at SaveFileDialog and most of it looked ok, but I
couldn't see where I can populate the actual content to be saved,
which would be my formatted HTML.

Have I missed some really obvious way of doing this?

Nicholas obviously thought your original question was simply about how to get a dialog that the user can use to specify a file to save. It's what I thought too.

If you're asking also for help in actually saving the data, then the dialog isn't going to do that for you. You still will want to use the dialog to get the path for where to save the data. But then you need to use that path to create some kind of file i/o class instance that can write the data for you (I think the StreamWriter class is probably a good choice for what you're doing...if you've got the HTML as a string, you can just write that whole string to the file with a StreamWriter instance).

Pete
.