Check Existence of File using C# (.NET)
Exists method of the System.IO.File class can be used to check if a file exists in a given location.
private static bool Check_file_Existence(string sFileName)
{
try
{
if (File.Exists(sFileName) == true)
{return true;
}
else
{ return false; }
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return false;
}
}
, IsExist Method in .NET, .NET File Class, .NET Exists Method