VB.NET integration example with TLL server

Imports System.Collections.Generic

Public Class TLLIntegration
    Private Shared bytInitChunk As Byte() = {59, 73, ...} ' Generate your own Init chunk in TLL Toolbox and paste it here. Make sure you put corresponding private key to the product settings in TLL server
    Friend Shared tlli As New TLLInterface(bytInitChunk, "5ss8:,UaAUhzTE?9trSjSynsxDxTRbn", True)

    Public Shared Sub ConfigureTLL()
        tlli.HWID.EnableMoreDistinctMode = True
        LoadCustomTranslation()
    End Sub

    Private Shared Sub LoadCustomTranslation()
        tlli.RegistrationFormTranslations.Clear()
        tlli.RegistrationFormTranslations.Add("License is activated. You can enter new license below.")
        tlli.RegistrationFormTranslations.Add("Your hardware ID: ")
        tlli.RegistrationFormTranslations.Add(" (double-click to copy)")
        tlli.RegistrationFormTranslations.Add("We're now searching valid license online. Please allow few seconds...")
        tlli.RegistrationFormTranslations.Add("Your license was automatically activated.")
        tlli.RegistrationFormTranslations.Add("Close")
        tlli.RegistrationFormTranslations.Add("Please enter your serial number.")
        tlli.RegistrationFormTranslations.Add("We're now verifying your serial number, please wait...")
        tlli.RegistrationFormTranslations.Add("Your license was successfully activated.")
        tlli.RegistrationFormTranslations.Add("It seems we're having issues with connection to activation server. Would you like to try offline activation?")
        tlli.RegistrationFormTranslations.Add("You must enter valid e-mail to activate your license.")
        tlli.RegistrationFormTranslations.Add("All files (*.*)")
        tlli.RegistrationFormTranslations.Add("We're now verifying entered license, please wait...")
        tlli.RegistrationFormTranslations.Add("E-mail")
        tlli.RegistrationFormTranslations.Add("Serial number")
        tlli.RegistrationFormTranslations.Add("Cancel")
        tlli.RegistrationFormTranslations.Add("Register")
        tlli.RegistrationFormTranslations.Add("Gives ERROR")
        tlli.RegistrationFormTranslations.Add("Load license from file")
        tlli.RegistrationFormTranslations.Add("License data")
        tlli.RegistrationFormTranslations.Add("Show more licensing options")
        tlli.RegistrationFormTranslations.Add("Migrate to new PC")
        tlli.RegistrationFormTranslations.Add("Offline activation")
        tlli.RegistrationFormTranslations.Add("Auto activation")
        tlli.RegistrationFormTranslations.Add("Delete local license")
        tlli.RegistrationFormTranslations.Add("Copy hardware ID")
        tlli.RegistrationFormTranslations.Add("We have deactivated license on this computer.")
        tlli.RegistrationFormTranslations.Add("Actual license was cleared from registry.")
        tlli.RegistrationFormTranslations.Add("HardwareID was copied to clipboard.")
        tlli.RegistrationFormTranslations.Add("Get offline license")
        tlli.RegistrationFormTranslations.Add("License is activated. License owner:")
        tlli.RegistrationFormTranslations.Add("How to activate license on offline computer")
        tlli.RegistrationFormTranslations.Add("1. Note your hardware ID:")
        tlli.RegistrationFormTranslations.Add("2. Note offline activation form URL")
        tlli.RegistrationFormTranslations.Add("3. Visit offline activation form on any other online computer, use hardware ID above and get license file for this PC.")
        tlli.RegistrationFormTranslations.Add("4. Copy the activation file (using USB drive, etc) to offline computer and use it.")
    End Sub
End Class
' You can add this method to your startup code or form/window load events, etc.
' This code runs synchronously. It's just an example and may need adjustment for your use case.

Private Sub TLLInit()
    TLLIntegration.ConfigureTLL()

recheck_license:
    If TLLIntegration.tlli.MyLicense Is Nothing Then
        ' Do something when in demo/no license state
        ' You can change the code below to open your own registration dialog that uses:
        ' TLLInterface.ActivateSerial and/or TLLInterface.ActivateHWID and/or TLLInterface.ActivateTrial methods

        Dim dres As DialogResult = TLLIntegration.tlli.ShowRegistrationForm(Me, "App license", "http://www.buyyourapp.com", Nothing, False)

        If dres = DialogResult.OK Then
            GoTo recheck_license
        Else
            Application.Exit()
        End If

    ElseIf TLLIntegration.tlli.MyLicense.IsDemo Then
        ' Any code you want to run when the user is running trial (e.g. a nag screen)

    Else
        ' Add your app code when full license is activated

        If TLLIntegration.tlli.OnlineRevocationCheck() Then
            TLLIntegration.tlli.AsyncSilentReactivation()
        Else
            ' Invalid/pirated license detected
            Application.Exit()
        End If
    End If
End Sub