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;
    

      

  • 相关阅读:
    线性回归损失函数求解
    【线性代数】四个基本子空间
    【线性代数】如何寻找一个投影矩阵
    【hihoCoder】#1133 : 二分·二分查找之k小数
    [LeetCode解题报告] 502. IPO
    [LeetCode解题报告] 703. 数据流中的第K大元素
    【排序】堆排序
    全文检索以及Lucene的应用
    MySql优化之mycat
    MySql优化之主从复制
  • 原文地址:https://www.cnblogs.com/Aamir-Ye/p/4544365.html
Copyright © 2011-2022 走看看