啟動你的VB,選擇ActiveX圖標.這個圖標可以在新建工程找到!VB會提供一個默認的工程名(project1)和類名(class1).我們會將這兩個名字都改掉.在改名之前,請首先確認我們擁有Microsoft Active Server Pages Object Library,它在我們的程序非常有用.從菜單中選擇"工程",然后在其中選擇"引用",就會出現"引用"窗口 從中選擇Microsoft Active Server Pages Object Library.
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
Private MyScriptingContext As ScriptingContext Private MyApplication As Application Private MyRequest As Request Private MyResponse As Response Private MyServer As Server Private MySession As Session
Public Sub OnEndPage() Set MyScriptingContext = Nothing Set MyApplication = Nothing Set MyRequest = Nothing Set MyResponse = Nothing Set MyServer = Nothing Set MySession = Nothing End Sub