This example demonstrates how to create and use a component that uses the ASP built-in objects. The myPowerMethod method, when invoked, calls a reference to the caller's object context. That reference is then used to access the built-in Request and Response objects. Request.ServerVariables is invoked to determine what kind of client browser is accessing the component, and a message is sent back to the client browser with the Response.Write method.
A read-only property is also implemented in this sample, as myPowerProperty. When this property is queried, the object context is again used to access the Request object, and determine the value of the SCRIPT_NAME variable.
In addition, this sample implements several methods, and a basic property. The myProperty property, along with methods to set and query the property, are included, as well as a simple method, myMethod, that can be used to convert the string contained in myProperty to uppercase.
Note This sample requires that you have MTS installed and running on your local computer. If MTS is not installed, or is not configured properly, the component will not function correctly.
This sample is provided for educational purposes only. It has not been tested in a production environment, and Microsoft® will not provide technical support for it.
This project is available in the ...\iissamples\sdk\components\c++\intermediate subdirectory of the Internet services directory.