BobLewiston
In Runtime
- Messages
- 182
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:
open existing text file:
append to text file:
create text file:
Code:
StreamWriter SW = File.CreateText ("MyFile.txt");
Code:
StreamReader SR = File.OpenText ("MyFile.txt");
Code:
StreamWriter SW = File.AppendText ("MyFile.txt");