Write to Text File.


//Use the using directive
using System.IO;

//Write to Text File.
private void WriteToTextFile(string filePath){

    StreamWriter tw = new StreamWriter(filePath);
    try{
         tw.Write(fileContent);
    }
    finally{
             tw.Close();
    }

}


You can view this article online at:
http://www.kiranreddys.com/knowledgebase/index.php/article/write-to-text-file