How to write ASP into a DLL selected from AppleBBS Blog
How to write ASP into DLL for keywords
Source
This article mainly turns ASP code into components. Developers not only speed up ASP, but also protect their own code.
Next, we will write a very simple component, the focus is to know how to develop DLL components instead of its complex code! These depend on your own future efforts.
Server-side components
First of all, the components on the server side should be different from those on the client side. The components on the client side are transmitted over the network and rely on HTML to work. They can only be useful in IE. However, the components on the server side run on the server and perform various operations on the server. Therefore, all browsers can enjoy it, and it relies on the server rather than the browser.
When IIS is requested to execute an ASP program, it will first find the code between the <%%> tags in the ASP file and execute it (can also be the code between <scriptrunat=server></script>). If this ASP program has been called before, it will use the compiled program in memory to return HTML code to the user. If not, it will recompile. Here, ASP has a little more speed advantage than CGI, because CGI uses a thread for each request. This greatly consumes the server's resources.
Do you want the program you wrote to run in IIS by yourself!?! Now you can do it! Using VB5 (of course it is VB6 now), you can create DynamicLinkedLibraries (DLL file), which can be run directly on IIS (if there is an asp file to request).
System and software requirements
You need a 32-bit operating system to run ASP. Of course, you also have to install IIS or PWS. Our following program was developed in the Windows95+PWS+VB5 environment.
Let's start
Start your VB and 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 will change both names. Before changing the name, please first confirm that we have Microsoft ActiveServerPagesObjectLibrary, which is very useful in our programs. Select "Project" from the menu and select "Reference" in it, and the "Reference" window will appear.
Select Microsoft ActiveServerPagesObjectLibrary from it.
Name projects and classes
Now let’s name project1 and class1 according to our hobbies! Naming them is also very important. We will use this project name and class name to create an instance of this component in the future! This will be introduced in detail later.
I don’t want to say more about how to change the name!
Our project name is changed to Example and the class name is Helloword
How to use engineering and classes
Now we have our own project (Example1) and class name (HelloWorld). In the future, we will use their names to reference this component in the ASP code. In ASP we will reference it like this, as follows:
SetObjReference=Server.CreateObject("ProjectName.ClassName")
The quote for our project is:
SetObjReference=Server.CreateObject("Example1.HelloWorld")