jmpatton
asked on
How To Saving a File To Disk C#
Hello,
I need to save a html file that I have created on the fly from within my WCF service. How can I do this?
Here is the code i'm using to create the file
I need to save a html file that I have created on the fly from within my WCF service. How can I do this?
Here is the code i'm using to create the file
using (FileStream fs = new FileStream("fileName.html", FileMode.Create))
{
using (StreamWriter w = new StreamWriter(fs, Encoding.UTF8))
{
w.WriteLine("<html>");
w.WriteLine("<head><title>File Title</title></head>");
w.WriteLine("<body>");
//stuff here
w.WriteLine("</body>");
w.WriteLine("</html>");
}
}
//ToDo: Save HTML file to c: drive
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window