Belirtilmiş klasör içindeki dosyaları FSO ile listeleme yapan bir uygulama.Dosyaların ismi ve boyut"u sıralanmakta. Kodu .asp uzantılı olacak şekilde kaydedip çalıştırmanız yeterli olacaktır.
Files Uploaded By Visitors of the site
|
i = 0 kk = 0 response.write "Files" response.write "No. Size File Name" Set objfilesysob1 = server.createobject("scripting.filesystemobject") set colfoldername1 = objfilesysob1.getfolder("C:/inetpub/wwwroot") set vfiles1 = colfoldername1.files for each vfileitem1 in vfiles1 kk = Left(vfileitem1.name, (Len(vfileitem1.name) - 0)) if vfileitem1.size 0 then i = i+1 if i response.write " " "align back the listing end if response.write "" & i & " " & round(vfileitem1.size/1024, 0) & "KB" if (vfileitem1.size/1024) response.write " " " these are to keep the columns aligned end if if (vfileitem1.size/1024) response.write " " end if if (vfileitem1.size/1024) response.write " " end if klump = vfileitem1.name klump = Replace(klump, " ", "%20", 1, -1, 1) response.write " " & kk & " " " this displays a link to the site/ftp...in this case, mines is ftp
end if next %>
|