如何自动生成txt文件日期 [英] How to Autogenerate txt File date wise
本文介绍了如何自动生成txt文件日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尊敬的会员
请查看此链接
log4net教程 [
Dear member
pls see this link
log4net Tutorial[^]
i want to autogererate txt page date wise meas every day new txt page generated with error message .
Thank you
推荐答案
我想您想每天创建日志文件.
如果是这样,这是它的一般逻辑.只需基于日期时间创建一个新的日志文件.具有定义的命名约定,例如: MyLogFile_mmddyyyyy.txt
现在,在进行任何日志记录之前,请检查今天的日期.根据日期,您知道日志文件名.在相关目录中搜索,看看它是否存在.如果是这样,则在其中写入,否则创建一个然后写入.
I guess you are want to create log files on daily basis.
If so, here is the general logic for it. Just create a new log file based on datetime. Have a defined naming convention, like: MyLogFile_mmddyyyy.txt
Now, before any logging, check today''s date. Based on date, you know the log filename. Search in the directory related and see if it exists. If so, write in it or else create one and then write.
这篇关于如何自动生成txt文件日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文