<fm*****@investec.co.za> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
I am trying to save html page using C# because i want to save the page
on the server not on the client side.
I can do that using Javascript the problem that i am having i want to
save the page on the server.
Exactly what do you want to save? Are you talking about a ASP.NET 2.0
applicaton from which you want to save the generated HTML before (or after)
sending it to the client? Or do you want to save the HTML from a random
remote web server? Or do you want to generate some HTML page and save
locally?
In either case, you'd probably want some code like this:
string htmlDocument = "<html><body>Hello world</body></html>";
FileStream fs = File.OpenWrite("C:\myfile.html");
StreamWriter writer = new StreamWriter(fs, Encoding.UTF8);
writer.Write(htmlDocument);
writer.Close();
...But of course, retrieving the actual HTML data is the challenge.
Frode Nilsen