zoukankan      html  css  js  c++  java
  • C# 根据时间创建文件夹

     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;
    

      

  • 相关阅读:
    集合set() 和 深浅copy
    Python 数据类型的操作——字典
    Python()- 面向对象
    面向对象的软件开发
    Python数据类型的操作——列表、元组
    Python 数据类型的操作——字符串
    Linux下386中断处理
    任务的休眠与唤醒
    Linux下SIGSTOP的特殊特征和实现
    内核线程对信号的处理策略
  • 原文地址:https://www.cnblogs.com/Aamir-Ye/p/4544365.html
Copyright © 2011-2022 走看看