I am new to C#. How can I write data into one file? This is my code so far:
public void convertHTML(string strData, string strTitle)
{
int position = strTitle.LastIndexOf('.');
strTitle = strTitle.Remove(position);
strTitle= strTitle + ".html";
StreamWriter sw = new StreamWriter(strTitle); //strTitle is FilePath
sw.WriteLine("<html>");
sw.WriteLine("<head><title>{0}</title></head>",strTitle);
//MessageBox.Show("this editor");
sw.WriteLine("<body>");
sw.WriteLine(strData); //strData is having set of lines
sw.WriteLine("</body>");
sw.WriteLine("</html>");//*/
lstHtmlFile.Items.Add(strTitle);
}
it will simply create one blank html file it won’t have any data
You can add block using in order to clean your
non managed objectLink : http://msdn.microsoft.com/fr-fr/library/vstudio/yh598w02.aspx