Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Fri Mar 16, 2012 8:46 am Post subject: INFO: Retrieving additional information about license validation failures. |
|
|
License validation can fail due to any number of reasons. For example, any license settings which require communication with the license service (for example, Max Activations) will fail if the license service is not reachable. To determine the underlying cause of the validation failure, use the CryptoLicense.GetStatusExceptionMessage method. This method can be used as follows:
Code: | Function GetAllStatusExceptionsAsString() As String
Dim ret As String
Dim status As Long
status = 1
While status < LicenseStatus.LS_LicenseServerMachineCodeInvalid ' highest possible status code
Dim tmp As String
tmp = appLicense.GetStatusExceptionMessage(status)
If Len(tmp) > 0 Then ' Additional info available for the status
If (Len(ret) > 0) Then ret = ret & Chr(10) & Chr(13)
ret = ret & GetStatusAsString(status) & ": " & tmp
End If
status = status * 2 ' next status code
Wend
GetAllStatusExceptionsAsString = ret
End Function
Function GetStatusAsString(status As Long) As String
Select Case status
Case LicenseStatus.LS_ActivationFailed: GetStatusAsString = "ActivationFailed"
Case LicenseStatus.LS_CumulativeRunTimeExceeded: GetStatusAsString = "CumulativeRunTimeExceeded"
Case LicenseStatus.LS_DateRollbackDetected: GetStatusAsString = "DateRollbackDetected"
Case LicenseStatus.LS_Deactivated: GetStatusAsString = "Deactivated"
Case LicenseStatus.LS_DebuggerDetected: GetStatusAsString = "DebuggerDetected"
Case LicenseStatus.LS_EvaluationExpired: GetStatusAsString = "EvaluationExpired"
Case LicenseStatus.LS_ExecutionsExceeded: GetStatusAsString = "ExecutionsExceeded"
Case LicenseStatus.LS_Expired: GetStatusAsString = "Expired"
Case LicenseStatus.LS_GenericFailure: GetStatusAsString = "GenericFailure"
Case LicenseStatus.LS_InstancesExceeded: GetStatusAsString = "InstancesExceeded"
Case LicenseStatus.LS_LicenseServerMachineCodeInvalid: GetStatusAsString = "LicenseServerMachineCodeInvalid"
Case LicenseStatus.LS_LocalTimeInvalid: GetStatusAsString = "LocalTimeInvalid"
Case LicenseStatus.LS_MachineCodeInvalid: GetStatusAsString = "MachineCodeInvalid"
Case LicenseStatus.LS_RemoteSessionDetected: GetStatusAsString = "RemoteSessionDetected"
Case LicenseStatus.LS_RunTimeExceeded: GetStatusAsString = "RunTimeExceeded"
Case LicenseStatus.LS_SerialCodeInvalid: GetStatusAsString = "SerialCodeInvalid"
Case LicenseStatus.LS_ServiceNotificationFailed: GetStatusAsString = "ServiceNotificationFailed"
Case LicenseStatus.LS_SignatureInvalid: GetStatusAsString = "SignatureInvalid"
Case LicenseStatus.LS_UniqueUsageDaysExceeded: GetStatusAsString = "UniqueUsageDaysExceeded"
Case LicenseStatus.LS_UsageDaysExceeded: GetStatusAsString = "UsageDaysExceeded"
Case LicenseStatus.LS_UsageModeInvalid: GetStatusAsString = "UsageModeInvalid"
End Select
End Function
|
|
|