zoukankan      html  css  js  c++  java
  • C#创建文件夹

    //获取当前文件夹路径
                string currPath = Application.StartupPath;

    //检查是否存在文件夹
                string subPath = currPath + "/pic/";
                if (false == System.IO.Directory.Exists(subPath))
                {
     //创建pic文件夹
                    System.IO.Directory.CreateDirectory(subPath);
                }
    //确认创建文件夹是否成功,如果不成功,则直接在当前目录保存
                System.DateTime currentTime = new System.DateTime();
                currentTime = System.DateTime.Now;
                string picName;
                picName =
                    currentTime.Year.ToString() +
                    currentTime.Month.ToString() +
                    currentTime.Day.ToString() +
                    currentTime.Hour.ToString() +
                    currentTime.Minute.ToString() +
                    currentTime.Second.ToString() +
                    currentTime.Millisecond.ToString() +
                    ".jpg";

                string picPath;
                if (false == System.IO.Directory.Exists(subPath))
                {
                    picPath = currPath + "/" + picName;
                }
                else
                {
                    picPath = subPath + picName;
                }

  • 相关阅读:
    anime.js 学习笔记
    swiper 报错 ‘ Can't find variable: Dom7’
    团队管理(二)
    团队管理(一)
    针对数值型数据的相关记录
    react+echarts折柱图实现
    侧边广告之心跳动画
    浅谈尾调用和尾递归
    elementUI 日期选择器获取CRON值
    elementUI 日期选择器之禁止年份事件二
  • 原文地址:https://www.cnblogs.com/qiantao/p/9389596.html
Copyright © 2011-2022 走看看