BobLewiston
01-18-2009, 08:35 PM
In C# console applications, isn't there a simpler way than handling exceptions to just find out if a text file of a given name exists in the current directory? I'm talking about something along the same lines as the following methods:
create text file:
StreamWriter SW;
SW = File.CreateText ("MyFile.txt");
open existing text file:
StreamReader SR;
SR = File.OpenText ("MyFile.txt");
append to text file:
StreamWriter SW;
SW = File.AppendText ("MyFile.txt");
create text file:
StreamWriter SW;
SW = File.CreateText ("MyFile.txt");
open existing text file:
StreamReader SR;
SR = File.OpenText ("MyFile.txt");
append to text file:
StreamWriter SW;
SW = File.AppendText ("MyFile.txt");