O controle de registro de certificado instanciado no VBScript
O exemplo do VBScript (Visual Basic Scripting Edition) a seguir usa a marca OBJECT para criar uma instância do objeto Controle de Registro de Certificado. O objeto é liberado da memória quando sai do escopo.
<HTML>
<HEAD>
<TITLE>VBScript Certificate Enrollment Control Sample
</TITLE>
<OBJECT classid="clsid:127698E4-E730-4E5C-A2b1-21490A70C8A1"
codebase="xenroll.dll"
id=Enroll >
</OBJECT>
<BR>
Certificate Enrollment Control Instantiation Sample
<BR>
<BR>
<SCRIPT language="VBScript">
<!--
' Declare a local variable.
Dim varName
' Enable error handling.
On Error Resume Next
' Attempt to use the control, in this case to retrieve a property.
varName = Enroll.MyStoreName
' If above line failed, Err.Number will not be 0.
if ( Err.Number <> 0 ) then
MsgBox("Error!")
Err.clear
else
' The control property was successfully retrieved,
' display the property value.
varName = "MyStoreName is " & varName
MsgBox( varName )
end if
-->
</SCRIPT>
<BR>
</HEAD>
</HTML>