how to check if a file exist C# code example
Example 1: c# check file exists
if (File.Exists(@"D:\myfile.txt")) {
Console.WriteLine("The file exists.");
}
Example 2: c# file exist
if (File.Exists("file.exe"))
{
//file exist
} else {
//does not exist
}