if (!Directory.Exists(dir))//如果不存在就创建 dir 文件夹 Directory.CreateDirectory(dir); 转载于:https://www.cnblogs.com/SeNaiTes/p/10701211.html