check if file exist csharp
Code Example - check if file exist csharp
if(File.Exists(@"C:\file.exe"))
{
Console.WriteLine("This file exists!");
}
else
{
Console.WriteLine("This file does not exist!");
}
csharp check file exists
if (File.Exists(@"D:\myfile.txt")) {
Console.WriteLine("The file exists.");
}
csharp file exist
if (File.Exists("file.exe"))
{
//file exist
} else {
//does not exist
}
csharp if file exists
if (File.Exists(@"D:\myfile.txt")) {
Console.WriteLine("The file exists.");
}