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

C# 根据时间创建文件夹

时间:2015-06-01 18:40:56      阅读:459      评论:0      收藏:0      [点我收藏+]

标签:

 string file = ((fileNameIndex)index).ToString();
                    if (!Directory.Exists(HttpContext.Current.Server.MapPath("~/admin/upload/") + ((fileNameIndex)index).ToString()))
                        Directory.Exists(HttpContext.Current.Server.MapPath("~/admin/upload/") + ((fileNameIndex)index).ToString());

                    if (!Directory.Exists(HttpContext.Current.Server.MapPath("~/admin/upload/") + file + "/" + DateTime.Now.ToString("yyyy")))
                        Directory.CreateDirectory(HttpContext.Current.Server.MapPath("~/admin/upload/") + file + "/" + DateTime.Now.ToString("yyyy"));

                    if (!Directory.Exists(HttpContext.Current.Server.MapPath("~/admin/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM"))))
                        Directory.CreateDirectory(HttpContext.Current.Server.MapPath("~/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM")));

                    if (!Directory.Exists(HttpContext.Current.Server.MapPath("~/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM/dd"))))
                        Directory.CreateDirectory(HttpContext.Current.Server.MapPath("~/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM/dd")));


                    if (!Directory.Exists(HttpContext.Current.Server.MapPath("~/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM/dd"))))
                        Directory.CreateDirectory(HttpContext.Current.Server.MapPath("~/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM/dd")));

                    imgsrc = HttpContext.Current.Server.MapPath("~/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM/dd/") + img);
                    imgsrc = "/admin/upload/" + file + "/" + DateTime.Now.ToString("yyyy/MM/dd/") + img;

  

C# 根据时间创建文件夹

标签:

原文地址:http://www.cnblogs.com/Aamir-Ye/p/4544365.html

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