Files.Item
JScript2.0+Syntax
files.Item
Description
The Item property sets or returns an item based on a specified key in a collection of files.
Example
Listing 9.68 shows how to use the Item property.
Listing 9.68 Example of the Item Property
<html> <body> <script language="JScript"> <!-- Hide // function gets the Item of the file collection // in a specified folder. function getItem(foldername) { var myObject, f, filesItem; // create instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); f = myObject.GetFolder(foldername); // gets the setup.exe file filesItem = f.files.Item("Setup.exe"); document.write("The file that you got is: " + filesItem); }// End Hide --> </script> <form name="myForm"> Enter ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.