Need help with IOException
how do i stop this from throwing an IOException?
namespace BrowseFileSystem
{
class Program
{
static void Main(string[] args)
{
string input = Console.ReadLine();
MemoryStream ms = new MemoryStream();
StreamWriter sw = new StreamWriter(ms);
sw.Write(input);
ms.WriteTo(File.Create(@"f:\textfile2.txt"));
sw.Close();
ms.Close();
//while (true)
//{
// try
// {
StreamReader sr = new StreamReader(@"f:\textfile2.txt");
Console.WriteLine(sr.ReadToEnd());
// }
// catch (Exception) { }
//}
}
}
}