JavaScript Tutorial/MS JScript/Drives

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

Drives

The Drives collection holds a read-only collection of all the available drives.

An item pointer is used to navigate through the items in the collection rather than an array index.

You can only move the current item pointer to the first or next element of a collection.

You can only access its item by using and Enumerator object.

Properties Associated with Drives Collection

Item Description Count Returns the number of items in the collection Item Set or return an item for a specified key in a Drives dictionary object



<html>
    <script language="JScript">
    <!--
    var fileSysObj = new ActiveXObject("Scripting.FileSystemObject");
    document.write(fileSysObj.Drives.count);
    -->
</script>
</html>


Drives.Count

The Count property contains the number of items in the collection.



<html>
    <script language="JScript">
    <!--
    var fileSysObj = new ActiveXObject("Scripting.FileSystemObject");
    document.write("There are ",fileSysObj.Drives.count," drives.");
    -->
    </script>
    </html>


Drives.Item()

Syntax



new enumeratorobj = Enumerator(Drives)
    enumeratorobj.Item()