Register a member, create your web development database, and use VB to write pure ASP programs
A few days ago, my elder brother told me that using ASP is really troublesome, the compilation environment is really bad. He always wrote in VB to debug
The code and then paste the code into the ASP program. To this end, I propose a solution here. Use VB to replace ASP
All objects write pure ASP programs in VB.
Everyone should know that in fact, many components in ASP are written in VB, but it makes everyone feel inconvenient
How to use several components inherent in ASP, such as Response, Request, Application, Session, etc. If I
If these components can be used directly in VB, then VB can be used to write ASP use program.
The following is a detailed step:
1. Create a new Activex Dll in VB. I have omitted those naming projects and classes.
2. Now you need to reference two DLL in VB.
The first is to quote the DLL of the ASP engine.
Select the Project/References command from the menu, and quote the "Microsoft Active Server Pages Object Library '.
If you did not find it, you can find this asp.dll file%systemdirectory%/system32/INETSVR directory in the following directory
Click the button 'browse ...' to import this dynamic connection library
The second is to quote the Microsoft Transaction Server (MTS) object. Select the same command and quote
'Microsoft Transaction Server Type Library'.
If you did not find it, you can find this mtxas.dll file in the following directory
%SystemDirectory%/System32/MTS/
3. Well, all the preparations are completed, how to write the code below, I think everyone can understand it.
This is the code of the file:
option explicit
dim m_objresponse as response
dim m_objrequest as request
DIM M_OBJSERVER As Server
dim m_objapplication as application
dim m_objSession as session
Private sub class_initialize ()
Dim Objcontext as ObjectContext
set objcontext = getObjectContext ()
set m_objresponse = ObjContext (response)
set m_objrequest = ObjContext (request)
set m_objserver = ObjContext (server)
set M_Objapplication = ObjContext (Application)
set M_ObjSession = ObjContext (session)
end sub
Public Sub ASPTEST ()
M_OBJRESPONSE.WRITE farewell to the writing board, use the VB environment to write ASP program!
end sub
Paste the above code into your program, and then compile this project to DLL. Final use
regsvr32 componentName.dll
Register this DLL to IIS.
The following is the method of using this component in the ASP file:
& nbs
||| p; <%set object = server.createObject (yourprjname.asptest)
objtest.asptest
set object = nothing
%>
Well, I hope my method can solve the elder brother's distress, haha.