<% 


dim i
dim txt

i=1
'有必要的话可以修改为自己的地址
    folderspec = server.mappath("/blog/attachments/") 
 
    Set fso = CreateObject("Scripting.FileSystemObject") 
    Set fold = fso.GetFolder(folderspec) 
    for each subfolder in fold.subFolders 
        'Response.Write(subfolder.Name & "<br>") 
		'call ListFolderContents(Server.MapPath(subfolder.Name))
		dim fs, folder, file, item,File2,FSO

		set fs = CreateObject("Scripting.FileSystemObject")
		set folder = fs.GetFolder(Server.MapPath("/blog/attachments/"&subfolder.Name))
		'Response.Write(Server.MapPath("/"&subfolder.Name) & "<br>") 
		for each item in folder.Files
			Set fso = CreateObject("Scripting.FileSystemObject")
			if right(item.Name,3)="jpg" or right(item.Name,3)="gif" or right(item.Name,3)="GIF" or right(item.Name,3)="JPG" then
				txt = txt & "&image"&i&"="&subfolder.Name&"/"&item.Name
				i = i + 1
			end if
		next
		
    next 
    set fold = nothing 
    set fso = nothing 
	txt=txt&"&total="&i-1
	

response.Write(txt)


%>

