启动你的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