|
Infralution Support Support groups for Infralution products
|
View previous topic :: View next topic |
Author |
Message |
MrDon Guest
|
Posted: Tue May 16, 2006 6:36 am Post subject: GetLicense questions (2) |
|
|
Sorry for posting twice. I think this can be a common interest question.
I successfully used the thecnique described in the topic "Can I license all the controls in a library with one key?" of the FAQ.
What I need now is simply retrieve licensing informations about:
- a given component of the library
- all the components of the library
To achieve this, I'm going to write a generic procedure that can be used:
- from an external application that uses the library
- from a procedure inside the library project, ut outside a component code
This is the code I tried:
Code: |
Dim sProvider As ControlLicenseProvider 'Inherits from EncryptedLicenseProvider
Dim sType As System.Type
Dim sAssembly As System.Reflection.Assembly
Dim sLicense As License
Dim sEncryptedLicense As EncryptedLicense
sType = GetType(Components.MyControl1)
sAssembly = System.Reflection.Assembly.GetAssembly(sType)
sProvider = New ControlLicenseProvider
sProvider.SetParameters(LICENSE_PARAMETERS)
sLicense = sProvider.GetLicense(LicenseManager.CurrentContext, sType, sAssembly, True)
sEncryptedLicense = CType(sLicense, EncryptedLicense)
|
...and this is another attempt:
Code: |
Dim sProvider As New ControlLicenseProvider
Dim sContext As System.ComponentModel.LicenseContext
Dim sAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly
sProvider.GetLicense(sContext, sAssembly, GetType(Components.MyControl1))
Dim sEncryptedLicense As EncryptedLicense = sProvider.GetLicense(LICENSE_PARAMETERS, "ControlCollection.lic")
ControlLicenseProvider.SetParameters(LICENSE_PARAMETERS)
Dim sComponent As Components.MyControl1 = New Components.MyControl1
mIsValid = LicenseManager.IsValid(GetType(Components.MyControl1), sComponent, mLicense)
|
They both does not works.
If possible, check the code, and say me what I missing, because I'm becoming crazy!
Thank you |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue May 16, 2006 9:19 am Post subject: |
|
|
See reply on previous post _________________ Infralution Support |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|