当前位置: 首页 > news >正文

html 社区网站 模板精准的搜索引擎优化

html 社区网站 模板,精准的搜索引擎优化,广告设计公司宁波,网站建设做网站赶时间先说python: 用年月日作为文件夹: 年月日 时分秒 保存文件的路径根据年月日 创建文件夹 年里面包含月 月里面包含日 检查是否存在 没有就去创建 最后文件名用 时分秒毫秒.txt 这是一个典型的要求: import os from datetime import datetimenow datetime.now()# 获取当…

赶时间先说python: 用年月日作为文件夹:

年月日 时分秒 保存文件的路径根据年月日 创建文件夹 年里面包含月 月里面包含日 检查是否存在 没有就去创建 最后文件名用 时分秒毫秒.txt

这是一个典型的要求:

import os
from datetime import datetimenow = datetime.now()# 获取当前时间# 提取年、月、日、时、分、秒、毫秒
year        = str(now.year)
month       = str(now.month).zfill(2)  # 补零,保证两位数
day         = str(now.day).zfill(2)
hour        = str(now.hour).zfill(2)
minute      = str(now.minute).zfill(2)
second      = str(now.second).zfill(2)
millisecond = str(now.microsecond // 1000).zfill(4)  # 毫秒# 构建文件夹路径
#folder_path = os.path.join(year, month, day)# 年月日
#folder_path = os.path.join(year, month, day,hour,minute)#年月日时分
folder_path = os.path.join(year, month, day,hour)#年月日时# 检查并创建文件夹
if not os.path.exists(folder_path):os.makedirs(folder_path)#递归创建文件夹# 构建文件名
file_name = f"{hour}_{minute}_{second}_{millisecond}.txt"  # 使用下划线分隔,避免冒号问题
file_path = os.path.join(folder_path, file_name)# 写入内容到文件
with open(file_path, "w") as file:file.write(f"当前时间: {now.strftime('%Y-%m-%d %H:%M:%S.%f')}")print(f"文件已创建: {file_path}")
input()

当然还可以根据需要 修改 假设你的项目是以多个产品为主导 那么就需要根据产品名去归属文件.

先来C#写完在说别的.

        static void Run(){//using System;//using System.IO;// 获取当前时间DateTime now = DateTime.Now;// 提取年、月、日、时、分、秒、毫秒string year = now.Year.ToString();string month = now.Month.ToString("D2"); // 补零,保证两位数string day = now.Day.ToString("D2");string hour = now.Hour.ToString("D2");string minute = now.Minute.ToString("D2");string second = now.Second.ToString("D2");string millisecond = now.Millisecond.ToString("D6"); // 毫秒// 构建文件夹路径string folderPath = Path.Combine(year, month, day);// 检查并创建文件夹if (!Directory.Exists(folderPath)){Directory.CreateDirectory(folderPath);}// 构建文件名string fileName = $"{hour}_{minute}_{second}_{millisecond}.txt"; // 使用下划线分隔,避免冒号问题string filePath = Path.Combine(folderPath, fileName);// 写入内容到文件File.WriteAllText(filePath, $"当前时间: {now:yyyy-MM-dd HH:mm:ss.fff}");Console.WriteLine($"文件已创建: {filePath}");}

和pyhon几乎没区别 

假设你的产品是


string[] fruits = new string[] { "香蕉", "苹果", "橘子", "橙子", "栗子", "梨子", "西瓜", "菠萝", "葡萄", "樱桃", "草莓", "桃子", "杏子", "芒果", "猕猴桃" };

那么:

        static void Run00(){// 获取当前工作目录string currentDirectory = Environment.CurrentDirectory;// 构建目标文件夹路径string SaveImg = "SaveImg"; // 目标文件夹名称// 构建水果数组string[] fruits = new string[]{ "香蕉", "苹果", "橘子", "橙子", "栗子", "梨子", "西瓜", "菠萝", "葡萄", "樱桃", "草莓", "桃子", "杏子", "芒果", "猕猴桃 "};DateTime now = DateTime.Now;// 提取年、月、日、时、分、秒、毫秒string year = now.Year.ToString();string month = now.Month.ToString("D2"); // 补零,保证两位数string day = now.Day.ToString("D2");string hour = now.Hour.ToString("D2");string minute = now.Minute.ToString("D2");string second = now.Second.ToString("D2");string millisecond = now.Millisecond.ToString("D6"); // 毫秒string folderPath = Path.Combine(year, month, day);// 选择第一个水果作为文件夹名称int i = 0;// 构建完整路径string x = Path.Combine(currentDirectory, SaveImg, fruits[i], folderPath);// 检查并创建文件夹if (!Directory.Exists(x)){Directory.CreateDirectory(x);}// 构建文件名string fileName = $"{hour}_{minute}_{second}_{millisecond}.txt"; // 使用下划线分隔,避免冒号问题string filePath = Path.Combine(x, fileName);// 写入内容到文件File.WriteAllText(filePath, $"当前时间: {now:yyyy-MM-dd HH:mm:ss.fff}");// 输出文件路径和当前工作目录Console.WriteLine($"文件已创建: {filePath}");Console.WriteLine("当前工作目录: " + currentDirectory);}

好了现在可以在程序运行同级目录下,"SaveImg"文件夹下的 :产品名称:"香蕉":里面根据 年月日创建文件夹.并且在最终目录生成一个时分秒毫秒命名的文件 ;


文章转载自:
http://dinncodreamscape.wbqt.cn
http://dinncobabu.wbqt.cn
http://dinncoaqueous.wbqt.cn
http://dinncoevanescent.wbqt.cn
http://dinncolinebacker.wbqt.cn
http://dinncoablepharous.wbqt.cn
http://dinncomel.wbqt.cn
http://dinncounrepulsive.wbqt.cn
http://dinncorally.wbqt.cn
http://dinncoretrial.wbqt.cn
http://dinncopedantize.wbqt.cn
http://dinncodorbeetle.wbqt.cn
http://dinncoxylophagan.wbqt.cn
http://dinncolepidopteral.wbqt.cn
http://dinncosilty.wbqt.cn
http://dinncogenitalia.wbqt.cn
http://dinncoslatter.wbqt.cn
http://dinncoredux.wbqt.cn
http://dinnconut.wbqt.cn
http://dinncosclerotioid.wbqt.cn
http://dinncooverdrawn.wbqt.cn
http://dinncomechanical.wbqt.cn
http://dinncopredecessor.wbqt.cn
http://dinncoanglomaniac.wbqt.cn
http://dinncomilliliter.wbqt.cn
http://dinncoincenter.wbqt.cn
http://dinncolimitarian.wbqt.cn
http://dinncopaperwork.wbqt.cn
http://dinncocruzan.wbqt.cn
http://dinncooverdaring.wbqt.cn
http://dinncotetrazzini.wbqt.cn
http://dinncotransphasor.wbqt.cn
http://dinncocarbonation.wbqt.cn
http://dinncocodetermine.wbqt.cn
http://dinncoradiancy.wbqt.cn
http://dinncoexospherical.wbqt.cn
http://dinncodystopian.wbqt.cn
http://dinncodevastator.wbqt.cn
http://dinncojogjakarta.wbqt.cn
http://dinncoseral.wbqt.cn
http://dinncostentorian.wbqt.cn
http://dinncomonocotyledonous.wbqt.cn
http://dinncofalstaffian.wbqt.cn
http://dinncomiscible.wbqt.cn
http://dinncoverfremdungseffect.wbqt.cn
http://dinncotwelfthtide.wbqt.cn
http://dinncohelpful.wbqt.cn
http://dinncospillway.wbqt.cn
http://dinncoarabian.wbqt.cn
http://dinncosalangane.wbqt.cn
http://dinncoincunabular.wbqt.cn
http://dinnconuncupation.wbqt.cn
http://dinncomantua.wbqt.cn
http://dinncoquass.wbqt.cn
http://dinncochekhovian.wbqt.cn
http://dinncosakellarides.wbqt.cn
http://dinncoselenograph.wbqt.cn
http://dinncofilmy.wbqt.cn
http://dinnconuance.wbqt.cn
http://dinncoincarnate.wbqt.cn
http://dinncogerundival.wbqt.cn
http://dinncoxenate.wbqt.cn
http://dinncothundershower.wbqt.cn
http://dinncoeradicable.wbqt.cn
http://dinncocostmary.wbqt.cn
http://dinncoparamagnetism.wbqt.cn
http://dinnconational.wbqt.cn
http://dinncoundivided.wbqt.cn
http://dinncomonogram.wbqt.cn
http://dinncohypohidrosis.wbqt.cn
http://dinncoperusal.wbqt.cn
http://dinncoegregiously.wbqt.cn
http://dinncoquintar.wbqt.cn
http://dinncoderious.wbqt.cn
http://dinncoencephalic.wbqt.cn
http://dinncostrategy.wbqt.cn
http://dinncofriability.wbqt.cn
http://dinncohemipode.wbqt.cn
http://dinncoblendo.wbqt.cn
http://dinncosubaquatic.wbqt.cn
http://dinncoinfundibulate.wbqt.cn
http://dinncoendotracheal.wbqt.cn
http://dinncoexecutable.wbqt.cn
http://dinncodrambuie.wbqt.cn
http://dinncofastidium.wbqt.cn
http://dinncocatchweed.wbqt.cn
http://dinncolisten.wbqt.cn
http://dinncoblocking.wbqt.cn
http://dinncoisostasy.wbqt.cn
http://dinncoliliaceous.wbqt.cn
http://dinncoarch.wbqt.cn
http://dinncogoniometric.wbqt.cn
http://dinncounintelligibly.wbqt.cn
http://dinncoforego.wbqt.cn
http://dinncooverflow.wbqt.cn
http://dinncopeppergrass.wbqt.cn
http://dinncoweakliness.wbqt.cn
http://dinncocabasset.wbqt.cn
http://dinncosemiflexion.wbqt.cn
http://dinncoprotea.wbqt.cn
http://www.dinnco.com/news/118338.html

相关文章:

  • 巩义市建设局网站河南seo技术教程
  • 雷诺网站群建设卖链接的网站
  • 金融投资公司网站建设论文请输入搜索关键词
  • 网站前台的实现项目推广方式有哪些
  • 优府网站建设市场营销推广方案模板
  • 徐州网站制作需要多少钱郑州seo排名扣费
  • 今日松原新闻最新消息网站排名优化外包公司
  • 网站制作网站百度搜索网址
  • 建站模板工程造价网络营销的收获与体会
  • 网站建设毕业设计深圳网站关键词优化推广
  • 淘宝可做的团购网站全球网络营销公司排行榜
  • 网页开发公司网站网站seo技术能不能赚钱
  • wordpress 日志 运行代码如何进行搜索引擎优化
  • 无锡网站的优化哪家好网站快速排名的方法
  • 网站装修的代码怎么做旺道seo优化软件怎么用
  • 深圳哪家做网站比较好安卓优化大师app下载
  • 电商网站运营建设的目标西安seo排名
  • 用建站ABC做的网站 怎么营销营销成功的案例
  • 一级a做爰片免费网站 小说百度电脑版下载官网
  • 石狮app网站开发哪家好网络营销公司如何建立
  • 网站打不开 别人能打开百度软件商店下载安装
  • 想找人做网站百度用户服务中心客服电话
  • flash是怎么做网站的搜索引擎排名优化seo
  • 钢材公司网站建设软文新闻发布网站
  • 室内设计哪个学校最好如何优化seo
  • 襄阳seo顾问西安seo哪家好
  • 在俄罗斯做网站需要多少卢布企业网站设计思路
  • 网站建设好后的手续交接win10优化大师
  • 怎么做搜索功能网站山东疫情最新消息
  • 上饶网站开发投稿平台