码迷,mamicode.com
首页 > Windows程序 > 详细

C# 创建子文件夹

时间:2016-08-24 17:25:18      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:

C# 创建子文件夹

 1    private void GreateFile(string directoryPath, string fileName)
 2         {
 3             //directoryPath一个路径变量
 4             //fileName文夹名字 
 5             try
 6             {
 7                 // Determine whether the directory exists.
 8                 if (Directory.Exists(directoryPath))
 9                 {
10                     DirectoryInfo dir = new DirectoryInfo(directoryPath);
11                     dir.CreateSubdirectory(fileName);
12                 }
13             }
14             catch (Exception e)
15             {
16                 MessageBox.Show("请确认根目录是否存在!");
17                 return;
18             }
19             finally { }
20         }

 

C# 创建子文件夹

标签:

原文地址:http://www.cnblogs.com/Alisa-study/p/5803615.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!