I wrote a small sample for u, this is for a web application
String strPath="c:";
String strFile="Temp.html";
private void SaveHTML_Click(object sender, System.EventArgs e)
{
StreamWriter strmEditWrite;
//delete the file if exists
File.Delete(strPath + strFile);
//create the file with new text
strmEditWrite = File.CreateText(strPath + "\\" + strFile);
//notice what i am passing to strmEditWrite.Write() it could be a string variable instead of TextField
strmEditWrite.Write(TextBo
strmEditWrite.Close();
}
Main Topics
Browse All Topics





by: purpleblobPosted on 2003-12-10 at 03:31:41ID: 9911403
Can you supply some further information - is this button in a WebForm (i.e. HTML or ASP.NET or similar) or is this a Windows form ?
Creating a file from C# is pretty simple and outputting HTML is pretty simple also so can you ellaborate on precisely what problems/issues you have with coding this ?