Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2003, 14:36
Avatar de emajesus
emajesus
 
Fecha de Ingreso: abril-2003
Mensajes: 278
Antigüedad: 22 años
Puntos: 1
FileSystemObject_Paginación

Estimados amigos:

¿Alguien dispone de un código de páginación [10 en 10] para el siguiente FileSystemObject?

Gracias,

Emajesus


<%@ Language=VBScript %>
<html>
<head>
</HEAD>
<BODY>

<%
dim strPathInfo, strPhysicalPath
strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)

Dim objFSO, objFile, objFileItem, objFolder, objFolderContents
Set objFSO = createObject("scripting.FileSystemObject")

Set objFile = objFSO.GetFile(strPhysicalPath)

Set objFolder = objFile.ParentFolder

Set objFolderContents = objFolder.Files
%>
<div align="center">
<center>
<table cellpadding=5 style="border-collapse: collapse" bordercolor="#111111" cellspacing="0" border="1">
<tr align=center><th align=left><font face="Verdana" size="2">File Name</font></th><th>
<font face="Verdana" size="2">Type</font></th><th>
<font face="Verdana" size="2">File Size</font></th><th>
<font face="Verdana" size="2">Last Modified</font></th></tr>
<%
For each objFileItem in objFolderContents
%>
<tr><td align=left>
<font face="verdana" size="2" color="darkgreen">
<a href="<%= objFileItem.Name %>"><%= objFileItem.Name %></a></font>&nbsp;</td>
<td align=right><font face="verdana" size="2" color="darkgreen"><%= objFileItem.Type %></font>&nbsp;</td>
<td align=right><font face="verdana" size="2" color="darkgreen"><%= objFileItem.Size %></font>&nbsp;</td>
<td align=right><font face="verdana" size="2" color="darkgreen"><%= objFileItem.DateLastModified %></font>&nbsp;</td>
</tr>
<%
Next
%>
</TABLE>
</center>
</div>
</BODY>
</HTML>

Al menos decidme si es posible ;)

Un saludo,

Emajesus

EUREKA : YO ME LO GUISO YO ME LO COMO

<html>
<head>
<title>Spoof Ads</title>
</head>
<body>
<%


strPhysicalPath = "/spoofs/" ' Mappen med filerne
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(Server.MapPath(strPhysicalPath))
Set objFiles = objFolder.Files


intPage = Request.Querystring("page")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If

intPageSize = 10 ' Antal filer på hver side
intImgCount = objFiles.Count
intPageCount = -Int(-(objFiles.Count/intPageSize))

Response.Write "<p><strong>" & objFiles.Count & " Imágenes - "
Response.Write "página " & intPage & " de " & intPageCount & ":</strong></p>"

For Each objFileItem In objFiles
intFile = intFile +1
If (intFile >= ((intPage-1)*intPageSize)+1) And (intFile =< (intPageSize*intPage)) Then
Response.Write "<p><a href='" & strPhysicalPath & objFileItem.Name & "'>" & strPhysicalPath &

objFileItem.Name & "</a></p>"
End If
Next

strScriptName = Request.Servervariables("ScriptName")
Response.Write "<p>Páginas: "
For i = 1 To intPageCount
Response.Write "<a href=" & strScriptName & "?page=" & i & ">" & i & "</a> "
Next
Response.Write "</p>"
Set objFS = Nothing
%>
</body>
</html>

Última edición por emajesus; 19/05/2003 a las 14:36