当前位置: 代码迷 >> ASP >> ASP的cs资料中怎样定期删除固定文件夹中的文件
  详细解决方案

ASP的cs资料中怎样定期删除固定文件夹中的文件

热度:110   发布时间:2013-01-07 10:02:24.0
ASP的cs文件中怎样定期删除固定文件夹中的文件
  

   string  FF = Server.MapPath(file);
   Set objFSO = Server.CreateObject("Scripting.FileSystemObject");
   objFSO.DeleteFile(Server.MapPath(file));

这个是网上找的方法,但是发现这个方法有问题,诸位大侠有没有好的方法!求代码!
------解决方案--------------------



sub delfile()
  '当前时间,设定时间
  dim currentTime,strTime
  currentTime=Day(date())
  strTime=2 每月2号
  if datediff("d",currentTime,strTime)=0 then
    set fso=Server.CreateObject("scripting.filesystemobject")
    if server.mappath() then
      fso.deletefile server.mappath() 
    end if
  end if
end sub
  相关解决方案