Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    Come visualizzare i file contenuti in una cartella sul mio dominio con asp

    Salve,ho provato con parecchi script,ma non sono riuscito a risolvere il mio problema,come da intestazione,io vorrei visualizzare su una pagina asp il contenuto di una cartella presente sul mio dominio,qualk1 ha uno script completo che mi può postare....

  2. #2
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    <%
    Percorso = Server.MapPath("miacartella")
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(Percorso)
    Set fc = f.Files
    For Each whatever in fc
    Nome_File = LCase(whatever.name)

    %>
    <tr>
    <td>
    <p align="right"><input type="button" value="<%=nome_File%>" name="<%=nome_File%>"></td>
    <td>
    [img]fileclick.asp[/img]</td>
    </tr>

    <tr>
    <%
    End if
    Next
    %>

  3. #3
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    codice:
    <% 
    Percorso = Server.MapPath("miacartella") 
    Set fs = CreateObject("Scripting.FileSystemObject") 
    Set f = fs.GetFolder(Percorso) 
    Set fc = f.Files 
    For Each whatever in fc 
    Nome_File = LCase(whatever.name) 
    
    %> 
    <tr> 
    <td> 
    <p align="right"><input type="button" value="<%=nome_File%>" name="<%=nome_File%>"></td> 
    </tr> 
    
    <tr> 
    <% 
    Next 
    %>

    c'era un end if di troppo

  4. #4
    Grazie..Funziona bene.Per visualizzare il contenuto come se stessi visualizzando la cartella hai qualche codice?

  5. #5
    mi ero accorto dell' "end if" e l'ho tolto

  6. #6
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    uhm no anche se non è complicato, il punto è che ti servono le immagini delle cartelle dei files..ti scrivo al volto qualcosa per farle vedere in modo ordinato:


    codice:
    <% 
    Percorso = Server.MapPath("newopenasp") 
    Set fs = CreateObject("Scripting.FileSystemObject") 
    Set f = fs.GetFolder(Percorso) 
    Set fc = f.Files 
    For Each whatever in fc 
    arr_Nome_File = split(LCase(whatever.name), ".")
    Nome_File = arr_Nome_File(0)
    x=x+1
    %>
    <tr>
    <td>
    <img url="pippo.gif" width="10" height="10">
    <a href="pagina.asp?<%=whatever.name%>"><%=nome_File%>
    </td>
    </tr>
    <%
    if x=10 then
    response.write("
    ")
    x=0
    end if
    Next 
    %>
    credo sia una buona base..probabile ci sia pure qualcosa di perfetto già fatto ciao

  7. #7

  8. #8
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    ah per le immagini usa una cosa cosi:

    <%
    Percorso = Server.MapPath("newopenasp")
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(Percorso)
    Set fc = f.Files
    For Each whatever in fc
    arr_Nome_File = split(LCase(whatever.name), ".")
    Nome_File = arr_Nome_File(0)
    x=x+1
    %>
    <tr>
    <td>
    <if arr_nome_file(1) = "asp" then
    <img url="asp.gif" width="10" height="10">
    <%elseif arr_nome_file(1) = "txt" then
    <img url="txt.gif" width="10" height="10">
    <%end if%>

    <a href="pagina.asp?<%=whatever.name%>"><%=nome_File% >
    </td>
    </tr>
    <%
    if x=10 then
    response.write("
    ")
    x=0
    end if
    Next
    %>


Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.