File和Directory是静态类
using System.IO; File.Exists(@"C:\1.txt");//判断文件是否存在 Directory.Exists(路径);//判断文件夹是否存在