如何在vb.net dll中访问http页面request等对象
bhguo 2018-08-28 05:31:38 大家好,我此前使用的是asp+VB6 DLL架构。asp用于前端的页面展现,DLL用于后端的业务处理与封装。在DLL中,可以使用ScriptingContext获取页面request等对象。现在,由于某项功能需要,个别页面的后端DLL需要采用vb .net编写,不知道如何获取页面request等对象。请指教,谢谢!相关代码如下:
1、asp代码
<HTML>
<BODY>
<%
dim MyDLL
set MyDLL=server.CreateObject("MyDLL.myClass")
%>
</BODY>
</HTML>
2、在vb6中,用ScriptingContext可获取页面request等对象
Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
Set MyContext = PassedScriptingContext
Set MyApplication = MyContext.Application
Set MyRequest = MyContext.Request
Set MyResponse = MyContext.Response
Set MyServer = MyContext.Server
Set MySession = MyContext.Session
End Sub
3、在vb .net中,如何获取页面request等对象?用Page_Load吗,似乎没用。。。
Public Class myClass Inherits System.Web.UI.Page
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
End Class