How to check whether a file exist or not

July 13, 2006 at 8:00 am 3 comments

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.

Advertisements

Entry filed under: ASP.NET.

An open-source ASP.NET menu server control Debugger Fails to Hit the Breakpoint When You Debug an ASP.NET Web Application

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

    Reply
  • 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

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

    hi

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Top Clicks

  • None

Calendar

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

Recent Posts

Feeds

Blog Stats

  • 92,980 hits

%d bloggers like this: