Ciao a tutti, avrei bisogno di aiuto per il seguente problema :
devo sistemare il seguente codice in modo che mostri i file presenti nelle cartelle sulle quali clicco, partendo da una directory iniziale, ovvero :
la prima pagina ha il seguente
codice:
<%
Percorso = Trim(LCase(Request.QueryString("percorso")))
If Percorso = "" then
Response.redirect "index.asp?percorso=d:\.......FileMan\"
Else
If Right(Percorso,1) <> "\" then Percorso = Percorso & "\"
Mostra_Directory Percorso
End If    
Function Mostra_Directory(cartella)
Set Fso = CreateObject("Scripting.FileSystemObject")
Set FL = fso.GetFolder(cartella)
Set SF = fl.SubFolders    
If Len(cartella) > 60 then
Precedente = ""
For f = len(cartella)-1 to 1 step -1
If Mid(cartella,f,1) = "\" and Precedente = "" then
Precedente = Mid(cartella,1,f)
End If
Next        
Response.write "<a href='index.asp?percorso=" & Precedente & "' TARGET='_parent'>..torna su di un livello</A><BR>"        
End If    
For Each FL in SF
Sotto_Cartella = FL.Name
If Len(cartella) < 60 then
Response.write Sotto_Cartella & "<BR>"
Else
Response.write "<a href='index.asp?percorso=" & Percorso & Sotto_Cartella & "' TARGET='_parent'>" & Sotto_Cartella & "</A><BR>"
end if
next
End Function
%>
la seconda (che devo sistemare) ha il seguente
codice:
<%
Percorso = Request.QueryString("percorso")
If Right(Percorso,1) <> "\" then Percorso = Percorso & "\"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Percorso)
Set fc = f.Files
Numero_File = 0
FP = ""
DF = ""
For Each whatever in fc
Nome_File = Trim(LCase(whatever.name))
If Nome_File <> "" Then Numero_File = Numero_File + 1
Select Case Right(Nome_File,4)
Case ".txt"
FP = FP & Nome_File & "<BR>"
DF = DF & "File di testo<BR>"
.....    
End Select
Next
%>
<FONT FACE="Arial" SIZE=2>
<%If Numero_File = 0 then%>
Nella directory corrente non sono presenti file.
<%ElseIf Numero_File = 1 then%>
E' stato trovato un solo file:<HR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD ALIGN=LEFT><FONT FACE="Arial" SIZE=2><%=FP%></FONT></TD>
<TD ALIGN=LEFT><FONT FACE="Arial" SIZE=2><%=DF%></FONT></TD>
</TR>
</TABLE>
<%Else%>
Sono stati trovati <%=Numero_File%> File:<HR>
<TABLE CELLPADDING=4  BORDER=1 WIDTH=100%>
<tr style="border-bottom-style: solid">
<td>Nome File</td>
<td>Tipo</td>
</tr>
<TR>
<TD ALIGN=LEFT><FONT FACE="Arial" SIZE=2><%=FP%></FONT></TD>
<TD ALIGN=LEFT><FONT FACE="Arial" SIZE=2><%=DF%></FONT></TD>
</TR>
</TABLE>
<%End If%>
Inizialmente vengono mostrati i file della cartella principale, ma se clicco su altre sottocartelle non venngono mostrati quelli della sottocartella su cui si clicca ma sempre quelli della cartella principale