vb封装asp的一些疑问

在网上看到过一些简单的例子给出的代码也能够执行但是有一个问题如下代码:OptionExplicitPrivateContextAsScriptingContextPriv... 在网上看到过一些简单的例子 给出的代码也能够执行 但是有一个问题 如下代码:

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 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 hello()
Response.Write "hello world!"
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

用上面代码生成dll调用后会出现一个hello world 如果改为html代码也是能够执行的,但是我想用来执行asp代码,比如我想让上面的hello world 变成<%=day(now)%> 来输出日期 又或者改成include xxxx.asp eval 等类似这样的,应该怎么操作?
展开
 我来答
剑民月期秒似一2521
2015-12-03 · TA获得超过4861个赞
知道小有建树答主
回答量:899
采纳率:100%
帮助的人:550万
展开全部
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 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 hello()
Response.Write day(Now())
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
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式