
14/05/2004, 13:12
|
| | Fecha de Ingreso: noviembre-2002
Mensajes: 21
Antigüedad: 22 años, 6 meses Puntos: 0 | |
Este es el codigo. Como comente, en la razi se demora mucho y luego avanza mas rapido. Si vuelvo a la raiz nuevamente toma tiempo. BUeno la "raiz" es el directorio donde se ha sefinido el URl.
<%@ Language=VBScript %>
<%
Response.Buffer = True
Response.Expires = 0
Response.AddHeader "Pragma", "no-cache"
%>
<%
Dim Clipboard, ClipboardCut,nOrder, rs
Dim PathPage, nTotMark
%>
<html>
<head>
<title>Files List</title>
<link rel="STYLESHEET" href="estilos.css" type="text/css">
</head>
<body style="font-family: Verdana; font-size: 8 pt" topmargin="0" leftmargin="0">
<%
Dim Ruta
Ruta = Request.QueryString("Path")
If Ruta ="" then
Ruta="/"
Else
Ruta = Ruta & "/"
End if
Response.Write "<img src='images/carpeta_abierta.gif'> Content of <a href='"&Request.Servervariables("SCRIPT_NAME")&"' class='menu'>" & "http://" & Request.Servervariables("SERVER_NAME") & "</a>"
Dim RutaSplit, i, Temporal, Tmp1, Tmp2
RutaSplit = Split(Ruta, "/")
For i = 0 to UBound(RutaSplit) - 1
Temporal = Temporal & "/" & RutaSplit(i)
Temporal = Replace(Temporal,"//","/")
Tmp2 = RutaSplit(i)
Tmp2 = Replace(Tmp2,"//","/")
If i = 0 then
Tmp1 = "<a href='"+Request.Servervariables("SCRIPT_NAME")+"?P ath=" & Temporal & "' class='menu'>" & Tmp2 & "</a> "
Else
If i = UBound(rutaSplit) - 1 then
Tmp1 = " / <b><a href='"+Request.Servervariables("SCRIPT_NAME")+"?P ath=" & Temporal & "' class='menu'>" & Tmp2 & "</a> </b>"
Else
Tmp1 = " / <a href='"+Request.Servervariables("SCRIPT_NAME")+"?P ath=" & Temporal & "' class='menu'>" & Tmp2 & "</a> "
End if
End if
Response.Write Tmp1
Next
Dim FSO, Carpeta, Archivo, ArchivosDelDir, Archivos, Peso, Modificado, Atributos, Subcarpetas, SubCarpeta, SubCNombre, SubCPeso
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Carpeta = FSO.GetFolder(Server.MapPath(Ruta))
Set ArchivosDelDir = Carpeta.Files
Set Subcarpetas = Carpeta.SubFolders
Response.Write "<table style='font-family: Verdana; font-size: 8 pt'><tr><td bgcolor='#D4D0C8'>"
%>
<div align="left">
<form method="post" style="margin-top: 0; margin-bottom: 0" name="frmAcciones" >
<table border="0" cellpadding="0" cellspacing="0" style="font-family: Verdana; font-size: 8 pt" width="100%">
<%
Dim CantSubC
CantSubC = 0
For Each SubCarpeta in Subcarpetas
SubCNombre = Subcarpeta.Name
SubCPeso = Subcarpeta.Size
%>
<tr style="background-color: #f0f0f0">
<td align="right" width="17%"></td>
<td style="padding-left: 10; padding-right: 10; padding-top: 2; padding-bottom: 2" width="83%">
<a href="<%=Request.Servervariables("SCRIPT_NAME")%>? Path=<% =Request.QueryString("Path") & "/" & SubCNombre %>" class="menu">
<% = SubCNombre %>
</a> </td>
</tr>
<%
CantSubC = CantSubC + 1
nOrder= nOrder + 1
Next
%>
<%
For Each Archivo in ArchivosDelDir
Archivos = Archivo.name
Peso = Archivo.Size
Extension = "|" & Right(Archivos,Len(Archivos)-InStr(Archivos,".")) & "|"
%>
<tr style="background-color: #f0f0f0">
<td align="right" width="17%"></td>
<td style="padding-left: 10; padding-right: 10; padding-top: 2; padding-bottom: 2" width="83%">
<%= Archivos%> </td>
</tr>
<%
Next
%>
</table>
<input type="hidden" name="Path" size="20" value="<% = Request.QueryString("Path") %>">
</form>
</div>
</body>
</html>
<%
Set FSO = Nothing
Set Carpeta = Nothing
Set ArchivosDelDir = Nothing
Set Subcarpetas = Nothing
%>
__________________ Junior ASP Programmer |