if oldphotofile<>"" then
set fs=CreateObject("scripting.filesystemobject")
set folder=fs.GetFolder(Server.MapPath("/center/lifephoto/"))
dim f_time,mylast_time,mylast_file
for each file0 in folder.files
if file0.name=oldphotofile then
'response.write "找到文件:"&file0.name&"<br>"
'response.write "folder:"&folder&"<br>"
'response.write "正在删除文件:"&file0.name&"<br>"
'response.write "删除"&file0.name&"成功!<br>"
file0.delete
exit for
end if
next
set fs=nothing
set folder=nothing
set fs=CreateObject("scripting.filesystemobject")
set folder=fs.GetFolder(Server.MapPath("/center/lifephoto/"))
dim f_time,mylast_time,mylast_file
for each file0 in folder.files
if file0.name=oldphotofile then
'response.write "找到文件:"&file0.name&"<br>"
'response.write "folder:"&folder&"<br>"
'response.write "正在删除文件:"&file0.name&"<br>"
'response.write "删除"&file0.name&"成功!<br>"
file0.delete
exit for
end if
next
set fs=nothing
set folder=nothing
本文转自 simeon2005 51CTO博客,原文链接:http://blog.51cto.com/simeon/100691