The third ingredient(s) in our ASP recipe are the Scripting Objects, which are available to us through the VBScript scripting engine the FileSystemObject object, the TextStream object and the Dictionary object.
The FileSystemObject object allows us to code a page that accesses the file system of the web server itself. If we use the FileSystemObject object correctly we could create a website with the same functionality as Windows Explorer if we so wished. The key to this ability is the hierarchy of collections and objects of which it is the root:
A Textstream object is created by a call to one of FileSystemObject methods, OpenTextFile or CreateTextFile, or to a File object's OpenAsTextStream method. Once created, it gives you read/write access to the contents of the text file specified in the method. Of course, this will only work if the file actually contains valid ASCII characters. Naturally, .txt files work with TextStream, and so will .htm or .asp files, which are displayed as source code. You might also wish to inspect .log files with this object as well. But don't expect decent results using TextStream to inspect a .dll or a .bin file.
The last of the three scripting objects, the Dictionary object, acts as aneasily accessible store for name/value (or key/item as they are properly known) pairs, generated by the application during a session. Dictionary objects usually last for the duration of the page but can be stored in a Session object for use in a more 'mobile' role.
We'll look at the Scripting objects again in Chapter 6.