• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 如何把ASP編寫成DLL(2)

    發表于:2007-07-14來源:作者:點擊數: 標簽:
    現在,無論什么時候用戶訪問一個帶有本組件的ASP文件,IIS就會把ScriptingContext傳送給我們的對象請我們使用.這個ScriptingContext包括了全部的ASP方法和屬性.實現上,這使得我們有能力訪問所有ASP的對象.看下面的代碼: Public Sub OnStartPage(PassedScriptin
    現在,無論什么時候用戶訪問一個帶有本組件的ASP文件,IIS就會把ScriptingContext傳送給我們的對象請我們使用.這個ScriptingContext包括了全部的ASP方法和屬性.實現上,這使得我們有能力訪問所有ASP的對象.看下面的代碼:

    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

    以后我們就能用在VB中用MyApplication 來代替ASP中的Application,同理可以代替Request,Server.....,不過我們來是要在 OnStartPage之前來申明這些變量:

    Private MyScriptingContext As ScriptingContext
    Private MyApplication As Application
    Private MyRequest As Request
    Private MyResponse As Response
    Private MyServer As Server
    Private MySession As Session

    使用ASP的對象
    我們的變量現在就能像標準的ASP對象來使用了!比如,我們經常在ASP中用Request.form()來收集提交表單的數據.現在我們在我們的VB中實現這個功能,代碼如下:

    用ASP中實現:
    〈%
    MyTempVariable = Request.Form("userName")
    Response.Write ("you entered "& MyTempVariable & "as your user name")
    %>

    在VB中實現:

    MyTempVariable = MyRequest.Form("userName")
    MyResponse.Write ("you entered "& MyTempVariable & "as your user name")

    通過使用MyResponse來代替Response,我們能夠使用所有Response的方法,當然,MyResponse這個名字可以隨便來取,你甚至可以就取Response.
    另一件我們得注意

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>