| Active Server Pages | ||
|
Active Server Pages (ASP) is a server-side technology for dynamically creating web pages on Microsoft Internet Information Services (IIS) platform. Web pages are created by combining HTML with scripting code, typically written in either VBScript or JScript. Creating ObjectsTo begin using one of the Scripting Edition components, you need to create an instance of the object in the script. This can be done in several ways, depending on the host environment where the script is executing. To create an instance of the object in ASP, you would use the Server.CreateObject method, such as:
In this example, the File Transfer Protocol object is created and assigned to the ftpClient variable. From this point on, ftpClient can be used to reference that instance of the component just as you would in Visual Basic. Note that the <% and %> markers are used in ASP to delimit the beginning and ending of scripting code in an ASP page. InitializationAfter an instance of the object has been created, the next step that you need to take is to call the Initialize method. This will prepare the component for use, validating the runtime license, loading any required networking libraries and allocating the system resources that it requires. The Initialize method has several optional arguments, however in most cases the only argument that is required is the runtime license key. This is a string of characters which is used to validate your development license. It is important to note that the runtime key is not your product serial number. For more information, refer to the section on Component Initialization. The following code demonstrates how the FTP component can be initialized:
Good coding practice dictates that for every time the Initialize method is called, it should be matched with a call to the Uninitialize method before the object is destroyed or the script terminates. This tells the component to release any resources that were allocated. Note that if your script does not explicitly call the Uninitialize method, it will be done automatically when the object is destroyed. |
||
|
Copyright © 2008 Catalyst Development Corporation. All rights reserved. |
||