Good thing, come to see it: (Reprinted from China net) how to write ASP as a DLL

Source: Internet
Author: User

Start writing a team piece (get started with components)
Theme
This article is mainly for the people who want to improve their ASP level to write! The ASP code into a component, the developer is not only to speed up the ASP, but also to protect their own code. This article is written, but also to give users want to develop components of an introductory lesson!
Next, we'll write a very simple component, focusing on knowing how to develop DLL components, not their complex code! It all depends on your own efforts in the future.
Server-side components
First, server-side components are different from the client's components. The client's components are transmitted over the network, depending on the HTML. And can only be useful on IE. but the server-side component is run on the server side, and it performs various operations on the server. So, all browsers are available, It relies on the server rather than the browser.
When IIS is requested to execute an ASP program, it first finds the code between the 〈%%> tags in the ASP file, and executes it (or it can be code between 〈script runat=server>〈/script>). If the ASP program was previously invoked, it would use an in-memory compiled program to return the HTML code to the user, and if not, it would recompile. Here ASP has a little more speed advantage than CGI, Because CGI is a thread used for every request. This greatly consumes the resources of the server.
If you don't want to write the program yourself, you can run it in IIS!?! You can do it now! With VB5 (now VB6, of course), you'll be able to create dynamic linked libraries (DLL files) that can run directly on IIS (if an ASP file is requested).
Requirements for systems and software
You need a 32-bit operating system to run the ASP. Of course you also have to install IIS or PWS. Our following program is developed under the WINDOWS95+PWS+VB5 environment.
Here we go
Start your VB, select the ActiveX icon. This icon can be found in the new project! VB will provide a default project name (Project1) and class name (Class1). We'll get rid of all two names. Before renaming, please confirm that we have Microsoft Active Server Pages Object Library, It's very useful in our program. Select project from the menu, and then select References in which the References window appears
Select the Microsoft Active Server Pages Object Library from.
Naming Projects and classes
Now we come to the name of Project1 and Class1 according to their hobbies! It is also important to name them, and we will use this project name and class name to create an instance of this component!
How to change my name, I don't want to say more!
Our project name is changed to Exmaple, class name is Helloword
How to use Engineering and class
Now we have our own engineering (EXAMPLE1) and class name (HelloWorld). We'll use their names in the ASP code to refer to this component in the future. In the ASP we are quoting as follows:
Related Article

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.