FolderBrowserDialog fgb = new FolderBrowserDialog(); //FolderBrowserDialog为用户选取文件夹的类
if (fgb.ShowDialog()==DialogResult.OK)
{
filePath = fgb.SelectedPath + "\\"+ System.DateTime.Now.Year.ToString();
DirectoryInfo di = new DirectoryInfo(filePath); //DirectoryInfo为操作文件夹的类
if (!di.Exists)
{
di.Create();
}
}
else
{
return;
}