Foxtable(狐表)用户栏目专家坐堂 → 定期删除30天前文件


  共有3225人关注过本帖平板打印复制链接

主题:定期删除30天前文件

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/2/11 18:58:00 [只看该作者]

 Dim dir As new io.DirectoryInfo("d:\")
For Each File As object In dir.GetFiles
    Dim sp As TimeSpan = Date.Now - cdate(file.CreationTime)
    If sp.TotalDays>="30"  Then '删除30天前文件
        msgbox(file.name)
        'file.delete
    End If
Next


 回到顶部
总数 20 1 2 下一页