[ActiveLock-Users]Invoking ALUGEN from ASP
Brought to you by:
ialkan
From: Thanh H. T. <th...@ya...> - 2004-08-16 04:06:55
|
Here's an example of how to call ALUGEN from an ASP page. For illustration only. I hope you find it useful. /Thanh ---- begin activateform.html ---- <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Product Activation</title> </head> <body> Product Activation Form: <form method="POST" action="activate.asp"> <table border="1" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"> <tr> <td width="25%" align="right">Product:</td> <td width="75%"><select size="1" name="Product"> <option selected value="TestApp">TestApp</option> </select></td> </tr> <tr> <td width="25%" align="right">Version:</td> <td width="75%"><select size="1" name="Ver"> <option selected value="1.0">1.0</option> </select></td> </tr> <tr> <td width="100%" align="right" colspan="2"> </td> </tr> <tr> <td width="25%" align="right">Organization:</td> <td width="75%"> <input type="text" name="Licensee" size="34" value="XYZ Company"></td> </tr> <tr> <td width="25%" align="right">Contact Name:</td> <td width="75%"> <input type="text" name="ContactName" size="34" value="Jane Doe"></td> </tr> <tr> <td width="25%" align="right">E-Mail Contact:</td> <td width="75%"> <input type="text" name="ContactEMail" size="52" value="jd...@xy..."></td> </tr> <tr> <td width="25%" align="right">Expiration Date:</td> <td width="75%"> <input type="text" name="Expiration" size="14" value="2004/12/31"></td> </tr> <tr> <td width="25%" align="right">Installation Code:</td> <td width="75%"> <input type="text" name="InstCode" size="83" value="MDAgNTAgREEgNTYgNTkgRTkKQTg2Ri1FMEMxCkV2YWx1YXRpb24gVXNlcg"></td> </tr> <tr> <td width="100%" align="right" colspan="2"> <input type="submit" value="Submit" name="B3"></td> </tr> </table> <p> </p> </form> </body> </html> ---- end activateform.html ---- ---- begin activate.asp ---- <html> <head> <title>Product Activation</title> </head> <body> <% Dim Prod, Ver, Licensee, Days, InstCode Prod = Request.Form("Product") Ver = Request.Form("Ver") Licensee = Request.Form("Licensee") Days = Request.Form("Days") ' Sample InstCode: MDAgNTAgREEgNTYgNTkgRTkKQTg2Ri1FMEMxCkV2YWx1YXRpb24gVXNlcg InstCode = Request.Form("InstCode") Dim ALGlobals set ALGlobals = CreateObject("ActiveLock2.Globals") Dim ALUGENGlobals Set ALUGENGlobals = CreateObject("ALUGENLib.Globals") Dim ALUGEN set ALUGEN = ALUGENGlobals.GeneratorInstance() ALUGEN.StoragePath = "C:\Program Files\ActiveLock Software Group\ActiveLock2\Bin\products.ini" dim dtExpire dtExpire = Now + Days strExpire = Year(dtExpire) & "/" & Month(dtExpire) & "/" & Day(dtExpire) dim strRegDate strRegDate = Year(Now) & "/" & Month(Now) & "/" & Day(Now) Dim LibKey LibKey = ALUGEN.GenKey(ALGlobals.CreateProductLicense(Prod, Ver, "", 0, 0, Licensee, strExpire, , strRegDate), InstCode) Response.Write(LibKey) %> </body> </html> ---- end activate.asp ---- |