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
Leave a Comment
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
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