ASP 101 - Active Server Pages 101 - Web05
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

 Top ASP 101 Stories Top ASP 101 Stories
Migrating to ASP.NET
Getting Scripts to Run on a Schedule
The Top 10 ASP Links @

Navigation Stars *
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

The Scripting Objects

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.

Previous Next

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers