How to Check if File Exists in C Sharp/C# ?

By | April 20, 2012


Use the following simple lines of code to check whether a particular file exists or not using C#/C Sharp.

using System;
using System.IO;

static class MainClass
    static void Main(string[] args)

It will return either True or False depending on whether your file exists or not.


Leave a Reply

Your email address will not be published. Required fields are marked *