How to check whether a file exist or not

July 13, 2006

There is method which makes it easy to check whether a file exist or not,

Code is given below

C#

if(System.IO.File.Exists(@”c:\test.xml”))

{

//True statements comes here

}

This code check whether a file named “test.xml” exist in the C:\ drive.

Entry Filed under: ASP.NET. .

3 Comments Add your own

  • 1. shaik .saleem  |  August 1, 2006 at 1:29 pm

    i have two tables same structure with different names the first tables have questionid,comment fields. i stored one comment on 29th day of some month when i open 2nd or 3rd of next month the data will be pass to next table. how to solve this plese give me advice

  • 2. Allan  |  May 29, 2008 at 6:23 pm

    HI!

    Can you send me all the program for testing if file exist or not? Thanks
    //Allan

  • 3. MT 05  |  August 26, 2008 at 10:13 am

    hi

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Top Posts

Top Clicks

Calendar

July 2006
M T W T F S S
    Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Tags

ASP.NET ASP.NET Tips WPF WPF Blog WPF Controls WPF thirdparty controls

a

Recent Posts

2

Fav links

Feeds

Blog Stats