Jump to content
Fórum Script Brasil
  • 0

Listar Aquivos De Uma Pasta



Uso o Script sintetizado abaixo para listar arquivos de uma determinada pasta pelo ASP, porem sempre a listagem se dá em ordem alfabética.

Gostaria de saber se é possivel pelo ASP ou componente listas das formas como é no windows, por tipo, data, tamanho ou até aleatórios.

Grato blink.gif

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
strCurrentFolder = "pasta"
Set objFolder = objFSO.GetFolder(server.mappath(strCurrentFolder))
IterateThroughDirectory objFolder

Sub IterateThroughDirectory(objFolder)
For Each objFile in objFolder.Files
    file = mid(objFile.Path, instrrev(objFile.Path, "\")+1)
    Response.write(file & "<br>")

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...