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

C# 判断当前目录是否存在不存在则创建

时间:2014-12-19 18:39:06      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:

/// <summary>
/// 判断目录是否存在不存在则创建
/// </summary>
/// <param name="Path"></param>
private static void ExitOrCreate(string Path)
{
if (!Directory.Exists(Path))
{
Directory.CreateDirectory(Path);
}
}

 

Example:ExitOrCreate(HttpContext.Current.Server.MapPath(“~/FileUpLoad/SavedTel”));

C# 判断当前目录是否存在不存在则创建

标签:

原文地址:http://www.cnblogs.com/a-mumu/p/4174319.html

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