%@ language="vbscript"%> %response.Expires = 0%> !--#include file="conn.asp"--> % Dim objFSO,objFolder,objFile,FF '声明 objFSO 变量存放对象实例 FF = Server.MapPath("pro_s/") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(ff) Then Response.write "文件夹 "ff" 里所有的文件:br>" Set objFolder = objFSO.GetFolder(ff)
For Each objFile in objFolder.Files %> % filename=cstr(objFile.name) myname=split(filename,".") ffname=myname(0) a=0 set sclass=conn.execute("select img from wksc_pro ") do while not sclass.eof
result=Instr(sclass("img"),ffname) a=a+result if(a>0) then exit do end if
sclass.movenext loop if(a=0) then response.Write ""objFile"" response.Write"br>" objFile.delete
end if %> % Next Else Response.Write "文件夹"ff"不存在,无法读取相关信息!" End If Set objFolder = Nothing Set objFSO = Nothing '释放 FileSystemObject 对象实例内存空间 %>