Как узнать, существует ли файл в C#/.NET?

System.IO.File:

using System.IO;

if (File.Exists(path)) 
{
    Console.WriteLine("file exists");
} 

csharp

c#

.net

io

2022-11-09T10:36:35+00:00