File input/output: Difference between revisions

m (Changed over to headers.)
Line 176:
tw.Close();
tr.Close();
}
else
{
Console.WriteLine("Input File Missing.");
}
}
}
}
 
There is an easier way:
 
using System;
using System.IO;
namespace FileIO
{
class Program
{
static void Main(string[] args)
{
if (File.Exists("input.txt"))
{
File.WriteAllText("output.txt", File.ReadAllText("input.txt"));
}
else
Anonymous user