Check if a file exist in CSharp
Description
The following code shows how to check if a file exist.
Example
//w w w . j a v a 2 s .c o m
using System;
using System.IO;
static class MainClass
{
static void Main(string[] args)
{
Console.WriteLine(File.Exists("c:\\test.txt"));
}
}
The code above generates the following result.