Visualizzazione dei risultati da 1 a 2 su 2

Discussione: File non trovato

  1. #1

    File non trovato

    Ho modificato il codice per visualizzare le immagiuni per data ma.....non trova i file...come se la cartella fosse vuota....dove sbaglio?
    codice:
    <%
    set custRs = Server.CreateObject("ADODB.Recordset")
    custRs.Fields.Append "nome", 200, 300 ' adVarChar
    custRs.Fields.Append "dimensione", 2, 4 ' smallint
    custRs.Fields.Append "data", 7 ' Date
    custRs.Open
    
    ' popolamento
    Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
    StrPath = Server.MapPath("/sicilia/agrigento/sciacca/citta")
    Set f = FileObject.GetFolder(strPath)
    
    For Each f1 in f.Files
      custRs.AddNew
      custRs("nome") = f1.name
      custRs("data") = f1.DateCreated 
    Next
    
    Set f = Nothing
    Set FileObject = Nothing
    
    custRs.Sort = "data DESC"
    
    %>
    
    
    
    <head>
    <link rel="stylesheet" type="text/css" href="upload.css">
    </head>
    
    <table border="0" width="550" cellspacing="0" cellpadding="0" bgcolor="#6699CC">
    	<tr>
    
    		<td width="510" align="center"><font size="1" face="Verdana" color="#F7F7F7">Wapp.it - Foto (<%=intTotalFiles%>)
              <div>Sciacca</div></font>
            </td>
    		
    	
    	</tr>
    </table>
    <table border="0" width="550" cellspacing="0" cellpadding="0" bgcolor="#f7f7f7" style="border: 1 solid #6699CC"><font color="#000080" face="Verdana" size="1">
      <tr>
        <td>
          <table width="540" cellspacing="0" cellpadding="0">
          
    <%
    If intTotalFiles > 0 Then
      col = 0
      imagecounter = 1
      
      If Request.QueryString("page").Count > 0 Then
        intPageNum = CInt(Request.QueryString("page"))
      Else
        intPageNum = 1
      End If
      
      
      For Each objFile in objFolder.Files
      
        'Response.Write imagecounter & "-" & (intPageNum*4)-3 & "-" & (intPageNum*4) &"
    "
        
        If (imagecounter >= (intPageNum*fileMAX)-(fileMAX-1)) And (imagecounter <= (intPageNum*fileMAX)) Then
          col = col + 1
          If col = 1 Then Response.Write "<tr>" & vbcrlf
          he = ImageHeight(StrPathShort & objfile.name)
          wi = ImageWidth(StrPathShort & objfile.name)
          resized = ImageResize(StrPathShort & objfile.name, 200, 200, "center")
          Response.Write "<td align=""center"" width=""135"">" & vbcrlf & "<table width=""100%""><tr><td align=""center"" height=""110""><table cellspacing=""0"" cellpadding=""0"" style=""border: 1 solid #6699CC""><tr><td>" & resized & "</td></tr></table></td></tr><tr><td align=""center"">" & objfile.name & "
    " & wi & "x" & he & "
    " & objfile.size & "byte
    " & objFile.DateCreated & "</td></tr></table>
    " & vbcrlf & "</td>" & vbcrlf
          If col = 4 Then
            Response.Write "</tr>" & vbcrlf
            col = 0
          End If
          'If col > 4 Then col = 1
        End If
        
        imagecounter = imagecounter + 1
        'If imagecounter > fileMAX Then Exit For
      Next
      
      If col > 0 AND col < 4 Then
        For colonne = col+1 To 4
          Response.Write "<td width=""135""></td>" & vbcrlf
        Next
        Response.Write "</tr>" & vbcrlf
      End If
    
    Else
    %>
            <tr><td align="center"></td></tr>
            <tr><td align="center">Non ci sono immagini</td></tr>
            <tr><td align="center"></td></tr>        
    <%
    End If
    %>

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    E quale sarebbe il file?

    Roby

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.