JavaScript Tutorial/MS JScript/Folders

Материал из Web эксперт
Перейти к: навигация, поиск

Folders

The Folders collection holds a read-only collection of all the available folders.

Because the Folder object is a collection, the folders can be accessed only by using an Enumerator object.

The properties associated with the Folders collection are listed in the following table.

Item Description Add Allows you to add a folder to the collection Count Returns the number of items in the collection Item Set or return an item for a specified key in a Drives dictionary object



   <source lang="javascript">

<html>

   <body>
   <script language="JScript">
   
   </script>
   </html></source>
   
  

Folders.Add()

Syntax



   <source lang="javascript">

folderscollection.Add(foldername)</source>


Folders.Count

The Count property returns the number of folders in the collection. Folders are added to this collection by using the Folders.Add() method.



   <source lang="javascript">

<html>

   <body>
   <script language="JScript">
   
   </script>
   Get the count of the c:\temp Folders collection.
   <form name="myForm">
   <input type="Button" value="Get Count" onClick="get()">
   </form>
   </body>
   </html></source>
   
  

Folders.Item

Syntax



   <source lang="javascript">

folderscollection.Item(foldername)</source>