if (Directory.Exists(temp_path) == false)//如果不存
{
//在就创建file文件夹
Directory.CreateDirectory(temp_path);
}
if (!System.IO.File.Exists(filename))
{
System.IO.File.Create(filename);//创建该文件
}
原文:https://www.cnblogs.com/dreamsails/p/12704309.html