C#删除定期老化文件的实用程序

web*_*bly 0 c# open-source utility

对C#实用程序(开源)的任何建议,可以清除/删除老化的文件.理想情况下作为服务运行.

Mic*_*tta 8

这是我作为计划任务运行的Powershell脚本:

dir c:\directory-to-watch | where {$_.LastWriteTime -lt
    [DateTime]::Today.AddDays(-7)} | del
Run Code Online (Sandbox Code Playgroud)

从c:\ directory-to-watch删除过去七天内未触及的所有文件.