In the following we have assumed that if you want an automatic system, however you could choose to run the Extended ActiveX control on the server in a manual system.
Steps 1-7 (in Procedure, below) explain how to implement an automatic system via ActiveX controls & Active Server Pages. A registration form enables users to select the licensing features they want to buy. An ASP page then processes the form to generate the licence keys, which it does by calling the Sheriff Extended ActiveX control.
The demo application located in the folder "SDK\ISR" shows how to implement a simple ASP page by using the Sheriff Extended ActiveX control. RegisterForm2.htm is a sample registration form and Register2.asp is the sample ASP page. The demo also shows how to automatically generate the Reference Code and authorise the user's PC with the licence key generated by the ASP page, which is done by calling the Sheriff Internet ActiveX control (SlsLocalComNet.dll) on the user's PC.
Microsoft has released useful information about ActiveX security and best practises here.
SlsLocalComNet.dll must be installed and registered on the client machine. Software publishers can distribute SlsLocalComNet.dll with their software packages and install & register it as part of the installation process. Alternatively, SlsLocalComNet.dll can be downloaded from Web sites and registered on the client PC by running "Regsvr32". Note that some browsers cannot run ActiveX controls.
SheriffEx.dll must be installed and registered on the server machine.
The software publisher sets up an HTML form that enables users to select from the the various licensing options. RegisterForm2.htm is an example of this type of registration form.
Once the user has selected the licence options to purchase, he/she will click on the "Submit" button to submit his/her order. The contents of the form will then be transmitted to the ASP page on the server specified by the ACTION attribute in the registration form. For example, in the RegisterForm2.htm, register2.asp is specified to process the form.
In the Register2.asp, the registration form is parsed to get the options that the user has selected together with the Reference Code
To generate the licence key, Register2.asp calls GetLicenceKey method from the SheriffEx ActiveX control with the Reference Code and licensing options.
Once the licence key is successfully generated, you can automatically authorise the client PC with the key. To do this, you need to call SetLicenceKey method from the SheriffNet ActiveX control that is already installed on the client PC. If you want to provide the optional "publisher data", call SetPublisherData method. Following is the script found in the Register2.asp.
Sheriff.ProductID = "9758-3050-1918-9292-6466"
alert("Your machine is successfully licensed");