C# Write Text Files / Write ASCII Files using C#
private void write_to_textfile()
{
try
{
StreamWriter SW = new StreamWriter(@"c:\vbadud\Sample.txt");
SW.Write ("This is a sample text");
SW.Flush() ;
SW.Close();
}
catch(Exception ex)
{
MessageBox.Show("Error writing file := " + ex.Message );
}
}
No comments:
Post a Comment