We learn to request
See how to get the content submitted in the component
Open VB6, create a new ActiveX DLL project. The engineering name is modified to FCOM, and the class name is modified to FZ4 reference "Microsoft Active Server Pages Object" object library. Create two component events: OnStartPage and OneundPage Create a reference to the class ScriptingContent in the event onstartpage. Instantiated class scriptingcontent.
code show as below:
Option expedition
'Statement of the object
DIM MyResponse as response
DIM MyRequest as Request
DIM MyApplication AS Application
DIM MyServer As Server
DIM MySession as session
'When the component is created, this event will be triggered.
Public Sub onstartPage (MyScriptingContent as scriptingcontext)
'Instantiation of objects
Set myresponse = myscriptingContent.response
Set myRequest = myscriptingcontent.request
Set myserver = myscriptingContent.server
SET myApplication = myscriptingcontent.application
Set mysession = myscriptingContent.Session
End Sub
'Trigger this event when the component is destroyed
Public Sub OneendPage ()
'Destroying object
Set myresponse = Nothing
Set myRequest = Nothing
Set myserver = Nothing
Set myapplication = Nothing
Set mysession = Nothing
End Sub
'It can be seen that put it in the previous ASP to VB, the way is the same.
Public Sub showRequest ()
DIM MyItem
'POST method
For Each MyItem in MyRequest.form
MyResponse.write myitem & ":" & myRequest.form (MyItem)
MyResponse.write "
"
NEXT
'Get
For Each MyItem in MyRequest.QueryString
MyResponse.write myitem & ":" & myRequest.QueryString (MyItem)
MyResponse.write "
"
NEXT
'Single information
MyResponse.write "one of these information is" & ":" & myrequest ("username")
MyResponse.write "
"
End Sub
test
Open Visual InterDev6.0 to generate a FZ41.asp file
<% @ Language = VBScript%>