tornado
Keywords: ASP, ActiveX control, digital signature, security
Let's take a look at how to get data from the server and pass it to the ActiveX control.
1) Use parameters binding when initialization
2) Get data at runtime
Open VB6, create a new ActiveX control project.
Engineering Name: FOCX, User Control Name: UC2
For convenience, we use the ActiveX Control Interface Wizard ..., Menu -> Add,> Explorer -> VB 6 ActiveX Control Interface Wizard. OK.
Open ActiveX Control Interface Wizard, Next Members choose Text, next step until completion. There will be some unwanted, delete, and
'note! Don't delete or modify the following is commented!
'MappingInfo = txtinfo, txtinfo, -1, text
Public property get getInfo () AS STRING
GetInfo = txtinfo.text
End Property
Public property let getinfo (Byval new_getinfo as string)
TXTINFO.TEXT () = new_getinfo
PropertyChanged "getInfo"
End Property
Private submmand1_click ()
Label2.caption = getInfo ()
End Sub
'Load the attribute value from the memory
Private sub UserControl_readproperties (Propbag As Propertybag)
Txtinfo.text = propbag.readproperty ("getInfo", "text1")
End Sub
'Write the attribute value to the memory
Private sub UserControl_WriteProperties (Propbag As Propertybag)
Call Propbag.writeProperty ("getInfo", txtinfo.text, "text1")
End Sub
Compiled into an OCX control. Run the generated test page. Default is Text1
How do I pass the server's data to OCX?
Using Microsoft ActiveX Control Pad tools can be easily found.
Use this tool to open the test page.
Menu -> Edit-> Edit ActiveX Control, huh, open a visual interface.
I saw it, there is a property box, we can set it, the code after the completion is as follows:
HEAD>
HEAD>
<%
DIM Svalue
Svalue = "This is the information of the client reader obtained by OCX"
%>
<%
DIM Svalue
Svalue = "This is the information of the client reader obtained by OCX"
%>
Function button1_onclick ()
{
GetClient.getInfo = '<% = svalue%>';
}
// ->
Script>
HEAD>