Web Hosting Offers
See the new scripts recently added to Dynamic Drive. Click here.
Original, practical CSS codes and examples such as CSS menus for your site.
    Search code samples  
 
  Keyword
 
 
 
   
 
 
  Code Samples
 
ASP
CSS
Dhtml
Html
Javascript
PHP
 
   
     LOGIN HERE  
 
Username
Password
Forgot Password
Verify Signup
 
 
 

ASP >> General

How can I list the contents of a directory?

Visitor Ratings (0) :
Description
1.) Create an instance of the FileSystemObject object
2.) Use the FileSystemObject to return a Folder object (which contains information about a particular directory).
3.) Use a For Each ... Next loop to iterate through each file in the Folder object.

If you want to get a listing of subfolders of a folder, you can use the same technique to iterate through the SubFolders collection of the Folder object.

See the following sample code:
Code
Select All
 Rate this Resource