C#判断是否有某文件夹存在

DirectoryInfo directory = new DirectoryInfo(@"D:\0001\" + year + @"\" + time.Substring(4,2) + @"\" + LocaleId + @"\");
if (!directory.Exists)//不存在
directory.Create();

posted @ 2017-01-23 13:15  成小伟  阅读(6621)  评论(0编辑  收藏  举报