using System;
using System.IO;
class FileWrite
{
public void WriteData()
{
FileStream fs
= new FileStream(@"C:\Test Folder\test.txt", FileMode.Open, FileAccess.Write);
StreamWriter sw
= new StreamWriter(fs);
string str
= Console.ReadLine();
sw.WriteLine(str);
sw.Flush();
sw.Close();
fs.Close();
}
public static void Main(String[]
args)
{
FileWrite fw
= new FileWrite();
fw.WriteData();
Console.ReadLine();
}
}
No comments:
Post a Comment