<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Duran Imports
<% dim x(1000) 'The directory of all my pictures... Const mypath="images/templateimages/headerrotate" Set filesystem = CreateObject("Scripting.FileSystemObject") Set folder = filesystem.GetFolder(server.mappath(mypath)) Set filecollection = folder.Files 'Step through the files list, keeping track of 'the number of files.... idx=0 For Each file in filecollection idx=idx+1 x(idx)=file.name Next 'Choose a random picture randomize timer whichNo=int(rnd()*idx)+1 'Clean up... set filesystem=nothing set folder=nothing set filecollection=nothing 'Display the image! response.write " & x(whichNo) & " %>
|