To check file exists or not in c#

Method to check whether the file is exist or not,



C#



if(System.IO.File.Exists(@”d:\mytest.xml”))

{

       //True statements comes here

}


This code check whether a file named “mytest.xml” exist in the D:\ drive or not.

Cheers,
Venkatesan Prabu .J
Ebook Download
View all
Learn
View all