<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Aiuto su questo script!]]></title><description><![CDATA[<p dir="auto">Carissimi<br />
utilizzo questo script come file manager, ma c'è una limitazione, al di sotto di 2 sottocartelle non mi fa visionare le altre cartelle, come correggerlo per far visionare tutte le sottocartelle?<br />
Per favore aiutatemi sono alle prime armi dell'asp.<br />
Grazie 1000<br />
G.<br />
Lo script è composto da 2 pagine la default.asp che ha per inclusione treeviewfunctions.asp<br />
Ecco i codici:</p>
<p dir="auto">Pagina - default.asp</p>
<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;TreeView&lt;/title&gt;
&lt;link rel=stylesheet href='treeview.css'&gt;&lt;/link&gt;
&lt;/head&gt;
&lt;/html&gt;
 
&lt;script language=javascript src='treeview.js'&gt;&lt;/script&gt;
&lt;!--#include file='treeviewFunctions.asp'--&gt;
 
&lt;%
    set fso = CreateObject("Scripting.FileSystemObject")
 
    vDir = "/public/"
    root = Server.MapPath(vDir) &amp; "\"
    set fold = fso.getFolder(root)
 
    ' we'll assume that the starting point is not empty
    ' (has at least one subfolder or one file)
 
    response.write getfoldlink("r0", "r0", fold, vDir)
    if fold.subfolders.count &gt; 0 then
 
        ' counter
        r1c = 0
 
        'loop through all subfolders in starting folder
        for each f in fold.subfolders
 
            ' another counter
            r1c = r1c + 1
 
            ' concatenate local/relative path once            
            sfoldname = root &amp; f.name &amp; "\"
            fpath = vDir &amp; f.name &amp; "/"
 
            set cfold = fso.getFolder(sfoldname)
            if cfold.subfolders.count &gt; 0 or cfold.files.count &gt; 0 then
 
                ' we need to make the folder a tree node
                response.Write getfoldlink("r1" &amp; r1c, "r1", cfold, fpath)
 
                ' reset counter
                r2c = 0
 
                for each sf in cfold.subfolders
 
                    ' keep track to identify nodes by id
                    r2c = r2c + 1
 
                    ' concatenate local/relative path once            
                    sfoldname = root &amp; f.name &amp; "\" &amp; sf.name &amp; "\"
                    path = vDir &amp; f.name &amp; "/" &amp; sf.name &amp; "/"
 
                    ' build an identifier for this node
                    id = "r2" &amp; r1c &amp; "_" &amp; r2c
 
                    set sfold = fso.getFolder(sfoldname)
                    if sfold.files.count &gt; 0 then
 
                        ' we need to make the folder a tree node
                        response.Write getfoldlink(id, "r2", sfold, path)
                        for each fil in sfold.files
                            response.write getfilelink("r2a", path, fil)
                        next
                        response.Write "&lt;/div&gt;"
                    else
 
                        ' this folder is not an expandable node
                        response.write getfoldlink("", "r2", sfold, path)
                    end if
                next
                for each fil in cfold.files
 
                    ' show each file in this subfolder
                    response.write getfilelink("r1a", fpath, fil)
                next
                response.Write "&lt;/div&gt;"
            else
 
                ' this folder is not an expandable node
                response.Write getfoldlink("", "r1", cfold, fpath)
            end if
        next
    end if
    for each fil in fold.files
 
        ' show the files in the starting folder
        response.write getfilelink("r0a", vDir, fil)
    next
    response.Write "&lt;/div&gt;"
 
    set fso = nothing
%&gt;
</code></pre>
<p dir="auto">Pagina: treeviewfunctions.asp</p>
<pre><code>function getfoldlink(d, c, f, p) 
if d &lt;&gt; "" then 
 
' needs to be clickable 
getfoldlink = "&lt;a href='#' style='cursor:hand' " &amp; _ 
"onclick='flip(""" &amp; d &amp; """);" &amp; _ 
"this.blur();return false;'&gt;" &amp; _ 
"&lt;img id='i" &amp; d &amp; "' class=" &amp; c &amp; _ 
" src=plus.gif vspace=0 hspace=2 border=0&gt;" &amp; _ 
"&lt;img src=folder.gif hspace=2 border=0&gt;&lt;/a&gt;&amp;nbsp;" &amp; _ 
"&lt;a target=_blank href=" &amp; p &amp; getsftitle(f) &amp; _ 
"&gt;" &amp; f.name &amp; "&lt;/a&gt;&lt;/div&gt;&lt;div id='" &amp; d &amp; "'" &amp; _ 
" display=none style='display:none'&gt;" 
else 
 
' can't be clickable 
getfoldlink = "&lt;div&gt;&lt;img id='i" &amp; d &amp; "' " &amp; _ 
"class=" &amp; c &amp; " src=plus.gif vspace=0 " &amp; _ 
"hspace=2 visibility=hidden style='visibility:hidden'&gt;&lt;img" &amp; _ 
" src=folder.gif hspace=2&gt;&amp;nbsp;&lt;a " &amp; _ 
"target=_blank href=" &amp; p &amp; getsftitle(f) &amp; _ 
"&gt;" &amp; f.name &amp; "&lt;/a&gt;&lt;/div&gt;" 
end if 
end function 
 
function getfilelink(c, fold, file) 
getfilelink = "&lt;div&gt;&lt;img class=" &amp; c &amp; " src=file.gif" &amp; _ 
" hspace=2&gt;&amp;nbsp;&lt;a href=" &amp; fold &amp; file.name &amp; _ 
getfiletitle(file) &amp; "&gt;" &amp; file.name &amp; "&lt;/a&gt;&lt;/div&gt;" 
end function 
 
function getfiletitle(file) 
getfiletitle = " title='Size: " &amp; _ 
formatnumber(file.size/1024, 2, -1, 0, -1) &amp; _ 
" kb" &amp; vbCrLf &amp; getDL(file) &amp; "'" 
end function 
 
function getsftitle(fold) 
getsftitle = " title='" &amp; getsfc(fold) &amp; _ 
vbCrLf &amp; getfc(fold) &amp; _ 
vbCrLf &amp; getfs(fold) &amp; _ 
vbCrLf &amp; getDL(fold) &amp; "'" 
end function 
 
function getDL(o) 
d = o.dateLastModified 
getDL = "Last mod: " &amp; formatdatetime(d, 2) &amp; _ 
" " &amp; formatdatetime(d, 3) 
end function 
 
function getfc(fold) 
getfc = fCount(fold.files.count) 
end function 
 
function getsfc(fold) 
getsfc = sfCount(fold.subfolders.count) 
end function 
 
function getfs(fold) 
getfs = "Size: " &amp; bToMB(fold.size) 
end function 
 
function bToMB(b) 
bToMB = formatnumber(b/1024/1024, 2, -1, 0, -1) &amp; " MB" 
end function 
 
function fCount(c) 
fCount = formatnumber(c, 0, -1, 0, -1) &amp; " file" &amp; _ 
suffix(c) 
end function 
 
function sfCount(c) 
sfCount = formatnumber(c, 0, -1, 0, -1) &amp; _ 
" subfolder" &amp; suffix(c) 
end function 
 
function suffix(c) 
if c &lt;&gt; 1 then suffix = "s" 
end function 
%&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/147002/aiuto-su-questo-script</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 13:29:01 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/147002.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Mar 2011 11:36:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Aiuto su questo script! on Mon, 07 Mar 2011 15:54:36 GMT]]></title><description><![CDATA[<p dir="auto">nessuno può aiutarmi?</p>
]]></description><link>https://dev.connect.gt/post/980639</link><guid isPermaLink="true">https://dev.connect.gt/post/980639</guid><dc:creator><![CDATA[djjunior]]></dc:creator><pubDate>Mon, 07 Mar 2011 15:54:36 GMT</pubDate></item></channel></rss>