C#文件夹Helper
using System.IO;
namespace ZhibiXiaobai.Uril.IOHelper
{
public class DirectoryIOHelper
{
/// <summary>
/// 判断文件夹存不存在-程序管理员权限
/// </summary>
/// <param name="FilePath">文件夹路径</param>
/// <param name="IsCreate">不存在时是否创建文件夹</param>
/// <returns>返回判断结果</returns>
public static bool ISExists_Directory(string FilePath, bool IsCreate = false)
{
if (Directory.Exists(FilePath))
{
return true;
}
else
{
if(IsCreate)
{
Directory.CreateDirectory(FilePath);
}
return false;
}
}
}
}