<%
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
%>
<%
Dim unita
Set unita = fso.GetFolder("D:\Inetpub\webs\lucagianlucacom\foto")
i=0
For Each File In unita.SubFolders
%>
<%
percorsoPhoto=http://www.lucagianluca.com/foto/
Dim objFSO, objFolderObject, objFileCollection, objFile
Dim intFileNumberToUse, intFileLooper
Dim objImageFileToUse
Dim strImageSrcText
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolderObject = objFSO.GetFolder("D:\Inetpub\webs\lucagianlucacom\foto\"&File.Name)
Set objFSO = Nothing
Set objFileCollection = objFolderObject.Files
Set objFolderObject = Nothing
Randomize(timer)
seme = Rnd()
intFileNumberToUse = Int(objFileCollection.Count * seme) + 1
intFileLooper = 1
For Each objFile in objFileCollection
If intFileLooper = intFileNumberToUse Then
Set objImageFileToUse = objFile
Exit For
End If
intFileLooper = intFileLooper + 1
Next
Set objFileCollection = Nothing
strImageSrcText = percorsoPhoto & objImageFileToUse.Name
Set objImageFileToUse = Nothing
if Right(strImageSrcText,5)<>"s.jpg" then
strImageSrcText=replace(strImageSrcText,".jpg","s.jpg")
End if
if Right(strImageSrcText,5)<>"s.JPG" then
strImageSrcText=replace(strImageSrcText,".JPG","s.jpg")
End if
%>

<%=File.Name%>
|
<%
i=i+1
if i=4 then
i=0
%>
<%
End if
Next
Set unita = Nothing
%>
<%
Set fso = Nothing
%>

|
|