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