啟動(dòng)你的VB,選擇ActiveX圖標(biāo).這個(gè)圖標(biāo)可以在新建工程找到!VB會(huì)提供一個(gè)默認(rèn)的工程名(PRoject1)和類名(class1).我們會(huì)將這兩個(gè)名字都改掉.在改名之前,請(qǐng)首先確認(rèn)我們擁有Microsoft Active Server Pages Object Library,它在我們的程序非常有用.從菜單中選擇"工程",然后在其中選擇"引用",就會(huì)出現(xiàn)"引用"窗口,從中選擇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