View Single Post
  #1  
Old 11-17-2015, 08:23 AM
kesk kesk is offline
Member
 
Join Date: Jul 2007
Posts: 18
Default Dotnet program license check

Code:
Public Shared Function IsLicensed() As Boolean
    Try 
        Dim license As License = LicenseManager.Validate(GetType(Verify_License), New Verify_License)
        If (license Is Nothing) Then
            Return False
        End If
        If (license.LicenseKey.CompareTo(GetType(Verify_License).GUID.ToString) <> 0) Then
            Return False
        End If
        Dim license2 As BaseLicense = TryCast(license,BaseLicense)
        Dim strArray As String() = license2.OwnerKey.Split(New Char() { "|"c })
        Dim i As Integer
        For i = 0 To strArray.Length - 1
            New Guid(strArray(i))
        Next i
        Return True
    Catch obj1 As Object
        Return False
    End Try
End Function
I understand from the above code that, when this function is called, it verifies the license info, and returns 1 if True or 0 if False.

So edited the code to return 1. This code is inside a dll. When this dll is called in the main program, to verify license, it should run. However, the program fails to run and there is no warning.

Further look into the evenlog directed that .Net security could be the reason and disabled the security in the application config file.

But still the program wont run. This license verification is done only in the main program and in the Main () event.

What am I missing here.

Any reply will be appreciated.
Reply With Quote