Definition of Script Object

Source: Internet
Author: User
Tags definition file system iis object model range
objects | scripts


5th Chapter Script Runtime Library objects
The previous chapters have described how ASPs can use instances of objects defined on the server, leveraging the methods and properties provided to extend the performance of the ASP. There are a range of objects to use, including script objects and standard iis/asp installed components, and objects that you create or purchase from other vendors. You can also download objects for free on the internet and use them on your own pages.
This chapter discusses objects that are generally referred to as "Script Runtime Libraries" (Scripting Runtime Library) provided by the ASP scripting environment. These objects are provided to code through the scripting engine being used to complete a variety of practical tasks with the ASP script.
Another component is the Active Server component (Active Server Component), which is implemented through a separate ActiveX DLL file or other file. The following chapters discuss the relevant content.
Of course, you need to look at how to use these objects on a page. In the previous chapter, we have learned how the server provides a way to instantiate an object, which is discussed in depth in this chapter.
This chapter describes the following:
· What the scripting engine provides as a scripting object.
· How to create a script object and other component instances.
· A summary of the members and properties of the script object.
· How to use script objects in your code.
Let's start by studying the definition of the Script object.

5.1 Definition of Script object
The ASP object model is studied in the previous chapters.
Object model is a basic means to understand the relationship between parts of a system.
The ASP object model provides a structure for manipulating HTTP requests, responses, and different elements in an ASP environment as a whole. For example, we've seen how to get any cookie value from the browser by looking at the cookie collection for the ASP Request object.
The scripting language we use also has an object model. However, this object model provided by the scripting language differs from the object model provided directly by the ASP DLL, which is provided by the Microsoft Script Runtime Library (scrrun.dll) when the default Active Scripting script engine is installed. The Microsoft Script Runtime Library is also installed.

5.1.1 Different types of objects and components
Don't be confused by the two nouns "objects" and "components," which, in a range, can be part of an ASP, and can also be accessed through COM. Conceptually, they can be grouped into four categories:
· ASP built-in objects, such as ObjectContext, Request, Response, Application, session, server, and ASPError. These are studied in chapters 2nd through 4th of this book.
· The Script object. Used by script runtime libraries, such as dictionary, filesystem, and TextStream. This is the object to be discussed in this chapter.
· The components that can be installed. Provided by Microsoft in the IIS 5.0 and ASP 3.0 standard installations. This will be discussed in the next chapter.
· Other components. Components purchased from other independent vendors, found on the Web site, or created by themselves. There are other components that are provided by Windows services or products, such as Windows Scripting Host. The corresponding list is provided in the appendix of this book, which contains a section on how to build your own components.

5.1.2 VBScript and JScript script objects
As part of the Script Runtime Library, Microsoft provides three main objects:
· The Dictionary object provides an extremely useful storage object that is used to store values, accessed and referenced by the object's name rather than its index. For example, this is appropriate for storing name/value pairs that are retrieved from the ASP Request object.
· The FileSystemObject object provides access to the server's underlying file system (IE 5.0 on the client, used in conjunction with a special type of page called "Hypertext Application (HTA)"). You can use the FileSystemObject object to traverse your computer's local and network drives, folders, and files.
· The TextStream object provides access to files stored on disk and is used in conjunction with FileSystemObject objects. TextStream objects can read or write text (sequential) files and can only be instantiated through FileSystemObject objects, so it is often assumed that TextStream objects are child objects of FileSystemObject objects.
The FileSystemObject object is the "parent" of a series of other objects and collections that are used to interact with the file system. This object provides three collections of objects: The drives, folders, and files collections, each of which is a collection of corresponding drive, folder, and file objects. They are used to traverse and locate drives, folders (directories), and files on disk. The relationships between objects are as shown in Figure 5-1:

Below, the objects and collections are described in turn, and how they are used. However, you first need to understand the differences between object instances and the way components are created or instantiated. This is the main part of the next section.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.