vb文件:
加入代码:
Option Explicit
Private Context As ScriptingContext
Private Application As Application
Private Response As Response
Private Request As Request
Private Session As Session
Private Server As Server
Public Sub show()
Response.Write "程序开始运行!"
End Sub
Public Sub rrr()
Response.Write ("<br>程序开发:孙天成")
End Sub
'引用内部对像
Public Sub OnStartPage(PassedscriptContext As ScriptingContext)
Set Context = PassedscriptContext
Set Application = Context.Application
Set Request = Context.Request
Set Response = Context.Response
Set Server = Context.Server
Set Session = Context.Session
End Sub
' 释放内部对象
Public Sub OnEndPage()
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
Set Context = Nothing
End Sub
Asp文件:
<% @ language="vbscript" %>
<!--METADATA TYPE="typelib" FILE="F:/Web/Budget/dll/budget.dll"-->
<%
Dim b1
Set b1=Server.CreateObject("v11.c11")
b1.show()
b1.rrr()
%>
运行结果:
![](https://i-blog.csdnimg.cn/blog_migrate/4491f6919dfdbf9b1b77dc599020741a.jpeg)
说明:
在更改过DLL 后, 更改结果不能马上显示出来'
可以结束dllhost.exe(
)进程,刷新页面。