<%
Function RandomImage(strPath)
Randomize()

If Right(strPath, 1) <> Chr(47) Then strPath = strPath & Chr(47)
strPhysical = Server.MapPath("/Resimler")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysical)
Set objFiles = objFolder.Files

For Each objFile in objFiles
strFile = LCase(objFile.Name)
strFiles = strFiles & strFile & vbTab
Next

strImages = Split(strFiles, vbTab)

If UBound(strImages) > 1 Then
RandomImage = strPath & strImages(Int(Rnd(1)*UBound(strImages)))
End If
End Function
%>

Kulanımı

<IMG SRC="<%=RandomImage("/resim")%>">

Alındıtır.

Kaynak : http://www.kodmerkezi.com/?part=down...&id=113&cat=55