C#判断文件夹是否存在,不存在则创建
2021-05-26 本文已影响0人
堆石成山
string folderPath="D:\\data"
//判断文件夹是否存在
if(!Directory.Exists(folderPath))
{
//创建文件夹
Directory.CreateDirectory(folderPath);
}
string folderPath="D:\\data"
//判断文件夹是否存在
if(!Directory.Exists(folderPath))
{
//创建文件夹
Directory.CreateDirectory(folderPath);
}