蜻蜓手游網(wǎng)小編最近把系統(tǒng)從PHP改成ASP的系統(tǒng),原來(lái)老的系統(tǒng)中的圖片地址做了跳轉(zhuǎn)處理。
比如請(qǐng)求的文件名是 http://pic.qtsyw.com/up/bak/ab17580b53edb0248cce640143b8bce9.png 但是實(shí)際上在服務(wù)器上面的路徑是 /ab/17580b53edb0248cce640143b8bce9.png 訪問(wèn)的時(shí)候把基中的 目錄名字當(dāng)成文件名來(lái)訪問(wèn),小編想了很外整理了一個(gè)簡(jiǎn)單的VBS腳本來(lái)處理,希望能給正好有這個(gè)需求的朋友一個(gè)提示。
'on error resume next
dim k,oFso,currentpath
k=0
set oFso=createobject("scripting.filesystemobject")
Function FilesTree(oSubFolder) '遍歷一個(gè)文件夾下的所有文件夾文件夾
dim sPath,sName
sPath = oSubFolder.Path
sName = oSubFolder.Name
Set oFolder = oFso.GetFolder(sPath)
Set oFiles = oFolder.Files
For Each oFile In oFiles
' Msgbox oFile.Path
'oFile.Delete
oFso.copyfile oFile,currentpath+"\back\"+sName +oFile.Name
Next
Set oFolder = Nothing
Set oSubFolders = Nothing
' Set oFso = Nothing
End Function
currentpath = createobject("Scripting.FileSystemObject").GetFolder(".").Path
Set oFolder = oFso.GetFolder(currentpath)
Set oSubFolders = oFolder.SubFolders
For Each oSubFolder In oSubFolders
if (oSubFolder.Name<>"back")then
FilesTree(oSubFolder)'遞歸
end if
Next
需要代碼的就直接下載吧 http://pic.qtsyw.com/up/2018-11/2018117234326280.txt
熱門評(píng)論
最新評(píng)論