Simple example of using VB6 to write ASP Components

Source: Internet
Author: User
Local debugging
1. Restart the WWW Service.
2. regenerate DLL

Server Registration
1. Manually register the DLL. Sorry to restart the server.
Regsvr32 rhasp. dll
Anti-registration
Regsvr32/u rhasp. dll

2. You can choose not to restart the server.
Use MTS (Microsoft Transaction Server)
MTS is a new feature of IIS 4, but it provides great improvements. MTS allows you to specify that only privileged users can use
Users can access the components, greatly improving the security settings on the website server. To register a component on MTS, follow these steps:
(1) Open the IIS console.
(2) Expand Transaction Server, right-click "pkgs installed" and select "new package"
(3) Click "Create an empty package"
(4) Name the package
(5) Specify the Administrator account or use "interactive" (if the server often uses administrator for login)
(6) Right-click the expanded "components" under the package you just created ". Select "New then component"
(7) Select "install new component"
(8) Find Your. dll file and select next.

To delete this object, you only need to select its icon and then select Delete.

Example

<%
'Server. Createobject ("project name. Class Name") during the call ")
Set rhasp = server. Createobject ("rhasp. Functions ")
Rhasp. printinfo ()
Set rhasp = nothing
%> '************************************* *********
Private myscriptingcontext as scriptingcontext
Private myapplication as application
Private myrequest as request
Private myresponse as response
Private myserver as server
Private mysession as session
'*************************************** *******

'*************************************** **************************
Public sub onstartpage (passedscriptingcontext as scriptingcontext)
Set myscriptingcontext = passedscriptingcontext
Set myapplication = myscriptingcontext. Application
Set myrequest = myscriptingcontext. Request
Set myresponse = myscriptingcontext. Response
Set myserver = myscriptingcontext. Server
Set mysession = myscriptingcontext. Session
End sub
'*************************************** **************************

'*********************************
Public sub onendpage ()
Set myscriptingcontext = nothing
Set myapplication = nothing
Set myrequest = nothing
Set myresponse = nothing
Set myserver = nothing
Set mysession = nothing
End sub
'********************************

Public sub printinfo ()
Myresponse. Write ("current time:" & now ())
End sub

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.