我希望在一个月文件之前删除2个日志文件与当前日期进行比较 [英] i want 2 delete log files before one month file compare with current date
本文介绍了我希望在一个月文件之前删除2个日志文件与当前日期进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在一个文件夹中我有很多错误日志文件我想在1个月之前删除日志文件与当前日期文件比较
提前b
in one folder i have lot of error log file i want to delete before 1 month log file compare with current date file
in advance thanxs
推荐答案
如果文件以逻辑方式命名(应该是这样),例如MyApplication_ yyyy - MM - dd .log
然后你可以根据目标日期拼凑一个名字并删除任何名字是的文件比它更好。
或者,根据我的喜好,每天创建一个子目录,你可以用类似的方式删除子目录。
If the files are named in a logical way (as they should be), such asMyApplication_yyyy-MM-dd.log
then you can cobble up a name based on the target date and delete any file whose name is less than it.
Or, as I prefer, create a subdirectory for each day, and you could delete the subdirectories in a similar manner.
我需要在目录中获取最新文件(按日期)
包含一些文件。使用VB.NET 2010
I need to get the most recent file (by date) in a directory
containing some files. using VB.NET 2010
这篇关于我希望在一个月文件之前删除2个日志文件与当前日期进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文