亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    asp刪除sql數(shù)據(jù)庫中沒有記錄的圖片

    asp刪除沒有記錄的圖片需要文件夾(存放圖片的文件夾)中的每個圖片和數(shù)據(jù)庫中的所有記錄進(jìn)行比較,采用雙重循環(huán)。把圖片進(jìn)行“.”分割后名字問前面部分,那其余數(shù)據(jù)庫中的 圖片路徑記錄進(jìn)行對比,采用vb的InStr函數(shù) 如果存在的話返回值>0,過可以得出結(jié)論

    代碼如下deal.asp

    <%@ language=”vbscript”%>  
    <%response.Expires = 0%>  
    <!–#include file=”conn.asp”–>  
    <%  
    Dim objFSO,objFolder,objFile,FF ‘聲明 objFSO 變量存放對象實(shí)例   
    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&”不存在,無法讀取相關(guān)信息!”   
    End If   
    Set objFolder = Nothing   
    Set objFSO = Nothing ‘釋放 FileSystemObject 對象實(shí)例內(nèi)存空間  
    %> 

     

    分享到: 更多

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號