C# 判断文件夹、文件是否存在

 if (Directory.Exists(temp_path) == false)//如果不存
   { 
       //在就创建file文件夹
       Directory.CreateDirectory(temp_path);
   }
if (!System.IO.File.Exists(filename))
   {
     System.IO.File.Create(filename).Close();//创建该文件 
    }