.net 平台下的File.Exists和directory .Exists() C#中判断文件夹或文件是否存在的方法

File.Exists(path + "a.txt")) //判断某个目录下是否存在某个文件
 
System.IO.Directory.Exists(@"E:Files")) //
判断文件夹是否存在,不存在则创建文件夹
 


//存在 

else 

//不存在 

}   使用非常简单吧。

转自http://www.codes51.com/article/detail_414.html