How Do I List the Contents of a Directory Using AS

Results 1 to 2 of 2

Thread: How Do I List the Contents of a Directory Using AS

  1. #1
    KingTV Guest

    Default How Do I List the Contents of a Directory Using AS

    I know this can be done, but I&#039ve spent about three hours trying to find information on it. I want to populate a drop-down menu with the contents of my images/sports/ directory using ASP. Please help!!! Thanks.

  2. #2
    Karl Guest

    Default RE: How Do I List the Contents of a Directory Usin

    This should get you going in the right direction<BR><BR><BR>&#060;%<BR>Dim myFolderObj, myFolder<BR><BR>set myfolderObj = Server.CreateObject("Scripting.FileSystemObject")< BR>Set myFolder = MyFolderObj.GetFolder("d:mp3raveheart\")<BR><BR>f or each thing in myFolder.Files<BR> response.write thing & "<BR>"<BR>next<BR><BR>Set myFolderObj = Nothing<BR>Set myFolder = Nothing<BR>%&#062;<BR><BR>that&#039s going to do the whole path as well..so you&#039ll have to parse out "thing" for just the filename...which isn&#039t hard.<BR><BR>something like:<BR>mid(thing, inStrRev(thing, "\")+1, len(thing) - inStrRev(thing,"\"))<BR><BR>*should* work.<BR><BR>karl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •