Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a html file and save in a folder

Tags:

c#

asp.net

I'm making a asp.net project. I'm trying to send mail contains a html page in attachment. I m generating HTML code. Now I want to write my HTML page and save it in a folder. I checked in web and this site but didn't find the working codes.

like image 918
Seration Avatar asked Nov 30 '22 19:11

Seration


1 Answers

File.WriteAllText() should do the Job

string content = GenerateHtml();
System.IO.File.WriteAllText(@"C:\yoursite.htm", content);
like image 169
fubo Avatar answered Dec 03 '22 08:12

fubo