方法1:    
using   System.IO;  
if (File.Exists("d:\a.exe"))   
  {
   //do something
  }
if (Directory.Exists("d:\abc\"))
  {
  //do something
  }
方法2:   
DirectoryInfo aPath = new DirectoryInfo(PathName);   
if   (aPath.Exists)  
  {
  //do something
  }
FileInfo aFile = new FileInfo(PathName);  
  {
  //do something
  }

相关文章:

  • 2021-09-29
  • 2022-12-23
  • 2021-05-17
  • 2021-11-12
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案