Buono sconto 4% su Toner e Cartucce agli utenti AZpoint. SU Iomiricarico.it!!
Introduzione
Questo script permette di simulare "Esplora Risorse"
Codice per lo script
<% '################################## '#Come
simulare Esplora
Risorse '################################## %>
<%@
language=VBScript%> <%option
explicit%> <html> <body style="font-family:
courier; font-size: 8 pt"> <% Function
UltimaModifica(data) Giorno = Day(data) If Giorno < 10 Then
Giorno = "0" & Giorno
Mese = Month(data) If Mese <
10 Then Mese = "0" & Mese
Ore = Hour(data) If Ore <
10 Then Ore = "0" & Ore
Minuti = Minute(data) If
Minuti < 10 Then Minuti = "0" & Minuti UltimaModifica =
Giorno & "/" & Mese & "/" & Year(data) & " "
&_ Ore & "." & Minuti End Function
const
default_path = "d:\inetpub\webs\bylucianicom\"
dim objfso,
objsubfolder, objfolder, objfile, tot_file, tot_subfolder dim
giorno, mese, ore, minuti, bytes dim strcurrentpath,
strpath
strcurrentpath =
request.querystring("path")
If strcurrentpath = ""
Then strcurrentpath = default_path end if
set objfso =
server.createobject("scripting.filesystemobject") set objfolder =
objfso.getfolder(strcurrentpath)
%> <table
border=1> <tr><td colspan=4>Directory:
<%=objfolder.path%></td></tr> <tr><td>Nome</td><td>Dimensione</td><td>Tipo</td><td>Ultima
Modifica</td></tr> <% if not
objfolder.isrootfolder then strpath =
objfolder.parentfolder.path strpath =
server.urlencode(strpath) %> <tr><td><a
href="browsedir.asp?path=<%=strpath%>">..</a></td> <td> </td><td> </td><td> </td></tr> <% end
if
tot_subfolder = 0 for each objsubfolder in
objfolder.subfolders tot_subfolder = tot_subfolder + 1 strpath
=
server.urlencode(objsubfolder.path) %> <tr><td><a
href=browsedir.asp?path=<%=strpath%>><%=objsubfolder.name%></a></td> <td> </td><td><%=objsubfolder.type%></td><td><%=UltimaModifica(objsubfolder.DateLastModified)%></td></tr> <%
next
tot_file = 0 for each objfile in
objfolder.files tot_file = tot_file + 1 bytes =
Int(objfile.size/1000) if bytes < 1 then bytes =
1 response.write "<tr><td>" & objfile.name &
"</td><td align=right>" &_ bytes & " KB"
& "</td><td>" & objfile.type &
"</td><td>"
&_ UltimaModifica(objFile.DateLastModified) &
"</td></tr>" next %> <tr><td
colspan=4 align=center><%=tot_file%>
file</td></tr> <tr><td colspan=4
align=center><%=tot_subfolder%>
directory</td></tr> <% set objfolder =
Nothing set objfso =
nothing %> </table> </body> </html>
|
|