The File class
The File class in the System.IO namespace provides static methods for creating, copying, deleting, moving, and opening files.
For example, the File.Exists method checks if a file exists at a specified path, and the different File.Get* methods return information about a file.
string path = "C:\Users\Public\Documents\MyFile.txt";
if (File.Exists(path)) {
Console.WriteLine(File.GetCreationTime(path));
Console.WriteLine(File.GetLastWriteTime(path));
Console.WriteLine(File.GetLastAccessTime(path));
File.Delete(path);
}