codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Cartelle
<%
id = request.querystring("id")
if request.QueryString("perc")="" then
'strSQL = "select * from consistenza_cp where id="&id
'set rs = server.createObject("ADODB.Recordset")
'rs.open strSQL, cn, 1, 3
'cartella = rs("cartella")
id=1
strPath = "wwwroot"
else
strPath=request.QueryString("perc")
end if
Dim objFso, objFolder, objFiles, strFolder, strFile
Set objFso = Server.CreateObject("Scripting.FileSystemObject")
dim subfolder
subfolder=""
if request.querystring("subf")<>"" then
subfolder=request.querystring("subf")
end if
if subfolder="" then
percorso=strPath
else
percorso=strPath & "/" & subfolder
end if
Set objFolderr =objFso.getfolder(server.mappath(percorso))
For each directoryfile in objFolderr.subfolders
%>
<%
if right(directoryfile.Name,3) <> "cnf" then %>
[img]images/dir.jpg[/img]
<a href="Untitled-2.asp?subf=<% =directoryfile.Name %>&id=<%= id %>&perc=<%= percorso %>">
<% =directoryfile.Name %></a>
<%
'conto quanti files
set objSubFold=objFso.getfolder(server.mappath(percorso & "/" & directoryfile.Name))
conteggioSottoCartelle=0
for each subcartelle in objSubFold.subfolders
conteggioSottoCartelle=conteggioSottoCar
telle+1
next
'Set objFiles1 = objSubFold.Files
'conteggioFiles=objFiles1.count
tot=conteggioSottoCartelle+conteggioFile
s
response.Write tot
set objSubFold=nothing
Set objFiles1 =nothing
%>
<% end if %>
<% Next %>
Documentazione
<%
For each directoryfile in objFolderr.files %>
<a href="<%=strPath%>/<% =directoryfile.Name %>">
<%
ext=right(directoryfile.Name,3)
select case ext
case "pdf","asp","htm","mdb","xls","ppt","doc","txt" %>
[img]images/<%= ext %>.jpg[/img]
<% case else %>
[img]images/unk.jpg[/img]
<% end select %>
<% =directoryfile.Name %></a>
<% Next
Set objFso = Nothing
if request.QueryString("perc")="" then
'rs.close
'cn.Close
'set rs = nothing
'set cn = Nothing
end if
%>
</body>
</html>