2、在工程引用中加入Microsoft Active Server Pages Object Library選擇
3、填加代碼如下:
'Code Start
'聲明部分 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 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
Public Sub OnEndPage() Set MyScriptingContext = Nothing Set MyApplication = Nothing Set MyRequest = Nothing Set MyResponse = Nothing Set MyServer = Nothing Set MySession = Nothing End Sub
'建立自定義函數(shù)SayHello
Public Sub SayHello() MyResponse.Write ("Hello World") End Sub