其实也没什么不一样的,说到不一样可能是它主要要用到ASP中的一些对象,如下面的代码,它可以实现在ASP网页中response request session application等的功能,在VB中要引用microsoft active server page object libraryOption Explicit Dim myCri As ASPTypeLibrary.ScriptingContext Dim myResponse As ASPTypeLibrary.Response Dim mySession As ASPTypeLibrary.Session Dim myRequest As ASPTypeLibrary.Request Dim myApplication As ASPTypeLibrary.ApplicationPublic Cn As ADODB.Connection Public Rs As ADODB.Recordset Public Rs2 As ADODB.RecordsetPublic Sub OnStartPage(mySc As ScriptingContext) Set myCri = mySc Set myResponse = myCri.Response Set mySession = myCri.Session End SubPublic Sub OnEndPage() Set myResponse = Nothing Set myCri = Nothing Set mySession = Nothing End Sub
Dim myCri As ASPTypeLibrary.ScriptingContext
Dim myResponse As ASPTypeLibrary.Response
Dim mySession As ASPTypeLibrary.Session
Dim myRequest As ASPTypeLibrary.Request
Dim myApplication As ASPTypeLibrary.ApplicationPublic Cn As ADODB.Connection
Public Rs As ADODB.Recordset
Public Rs2 As ADODB.RecordsetPublic Sub OnStartPage(mySc As ScriptingContext)
Set myCri = mySc
Set myResponse = myCri.Response
Set mySession = myCri.Session
End SubPublic Sub OnEndPage()
Set myResponse = Nothing
Set myCri = Nothing
Set mySession = Nothing
End Sub
http://www.dapha.net/VB/list.asp?id=1507