<%
Set fso = CreateObject("Scripting.FileSystemObject")
photofile="../"&rs("img") '//图片路径
filepath=server.mappath(photofile)
photofile1="../00/"&rs("img") '//图片路径
filepath1=server.mappath(photofile1)
if fso.FileExists(filepath)=true then
Set file = fso.GetFile(filepath)
file.Move(filepath1)
'file.delete
end if
set file=nothing
set fso=nothing
%>
以前做网站中没有考虑删除信息了,没有删除相应的图片,因为存在好几张表中都有图片,如果找不存在的不好处理,在网上搜了一下,现在找了一个办法,先将存在有用的图片给转移到另一个文件夹中,把剩余的删除,就搞定了。