OK. In Java looks like this:
Hasp hasp = new Hasp(Hasp.HASP_DEFAULT_FID);
Hasp haspLicense = new Hasp(FEATURE_WITH_EXECUTION_COUNT);
String scope = "?xml version=\"1.0\" encoding=\"UTF-8\"?> +
<haspscope> +
<feature execution_count_to_consume=\"numberToConsume\" /> +
</haspscope>";
haspLicense.loginScope(scope, vendorCode);
It consumes numberToConsume licenses and returns 0.
After, execute this:
String haspScope = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> +
<haspscope> +
<hasp id=\"keyId\" /> +
</haspscope>"
String haspFormat = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> +
<haspformat root=\"hasp_info\"> +
<feature> +
<attribute name=\"license\" /> +
</feature> +
</haspformat>"
String haspInfo = hasp.getInfo(haspScope, haspFormat, vendorCode);
Thanks,