WinForm 在相对路径中自动新建文件夹

/// <summary>
/// 创建Conifg文件夹
/// </summary>
public static void CreadConfigFile()
{
try
{
string path = Application.StartupPath + "\\Config";
if (!File.Exists(path))//如果不存在就创建file文件夹
{
Directory.CreateDirectory(path);
}
}
catch (Exception ex)
{
throw ex;
}
}

posted @ 2022-02-28 15:03  KevinSteven  阅读(381)  评论(0编辑  收藏  举报