Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GetLicense questions (2)

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
MrDon
Guest





PostPosted: Tue May 16, 2006 6:36 am    Post subject: GetLicense questions (2) Reply with quote

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

PostPosted: Tue May 16, 2006 9:19 am    Post subject: Reply with quote

See reply on previous post
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
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