Visualizzare tutti i files presenti in una directory

  • Creatore Discussione Creatore Discussione jan267
  • Data di inizio Data di inizio

jan267

Utente Attivo
6 Mar 2003
1.950
2
38
36
Milano
twitter.com
Come dice il titolo di questo 3d lo script sottostante permette la visualizzazione di tutti i files presenti in una cartella.
Ecco il codice:
Codice:
<% 
strCartella = "./"
Set Lista = Server.CreateObject("Scripting.FileSystemObject") 
strPath = Server.MapPath(strCartella) 
Set f = Lista.GetFolder(strPath) 
Set fc = f.Files 

a = 0 
For Each f1 in fc 
a = a+1 
	Response.Write "<b>"&a&".</b> <a href=""?file=/"&f1.name&""">"&f1.name&"</a><br>" 
Next 

Set fc = Nothing 
Set f = Nothing 
Set Lista = Nothing 

If Request.QueryString("file")<>"" Then
	Response.Buffer = True
	Response.Redirect "." & Request.QueryString("file")
End If	
%>
Puo` anche essere utile anche se non sembra... :)
Bye :)

P.S. Luke, magari puoi tradurlo in JScript :)
 

Discussioni simili