Dual Loop is used. Split the image into "." and ask the previous part of the name. Then compare the image path records in other databases.
If the InStr function of vb exists, the returned value is greater than 0, so we can draw a conclusion.
The Code is as follows: deal. asp
Copy codeThe Code is as follows: <% @ language = "vbscript" %>
<% Response. Expires = 0%>
<! -- # Include file = "conn. asp" -->
<%
Dim objFSO, objFolder, objFile, FF 'declare the objFSO variable to store the object instance
FF = Server. MapPath ("pro_s /")
Set objFSO = Server. CreateObject ("Scripting. FileSystemObject ")
If objFSO. FolderExists (ff) Then
All files in Response. write "folder" & 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.exe cute ("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 "folder" & ff & "does not exist. Related information cannot be read! "
End If
Set objFolder = Nothing
Set objFSO = Nothing 'to release the memory space of the FileSystemObject object instance
%>
From: http://blog.csdn.net/lingfeng179/archive/2009/08/19/4463679.aspx