Salve,
utilizzo questo script per scorrere tutte le foto da una cartella tramite fso, come posso impostare di visualizzare solo 2 (per esempio) foto invece di tutte?
Grazie
G.
codice:
<%
strPath = "fotogallery/" 
strExt = ".JPG"

Set objFso = Server.createObject("Scripting.FileSystemObject") 
Set objFolder = objFso.GetFolder(Server.MapPath(strPath)) 
Set objFiles = objFolder.Files 


set custRs = Server.CreateObject("ADODB.Recordset")
custRs.Fields.Append "nome", 200, 300 ' adVarChar
custRs.Fields.Append "data", 7 ' Date
custRs.Fields.Append "fotos", 3 ' adInteger 

custRs.Open
If objFiles.count > 0 then
For Each strFile in objFiles

custRs.AddNew
custRs("nome") = strFile.name
custRs("data") = strFile.DateCreated      
next

custRs.Sort = "data ASC"
custRs.Sort = "fotos" 

custRs.movefirst
 Do until custRs.eof
    
	if Right(lcase(custRs("nome")), Len(strExt)) = lcase(strExt) then 
	%>
[img]square.aspx?img=<%=strPath%><%=custRs([/img]&opx=180"/>


<%
end if

custRs.movenext

loop
else
end if
Set objFso = Nothing 
Set objFolder = Nothing
Set objFiles = Nothing 
custRs.Close
set custRs = Nothing
%>