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 

How to Apply the Encrypted Licensing to a VS2010 Project

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



Joined: 21 Feb 2012
Posts: 13
Location: Biloxi, MS

PostPosted: Tue Feb 21, 2012 4:10 pm    Post subject: How to Apply the Encrypted Licensing to a VS2010 Project Reply with quote

I did the following:
Define the compilation constant ILS_FORMS in the Build tab of the Project Properties.

Add the following source code files to your project:

EncryptedLicense.cs
EncryptedLicenseProvider.cs
EvaluationMonitor.cs
RegistryEvaluationMonitor.cs or IsolatedStorageEvaluationMonitor.cs
EvaluationDialog.cs
EvaluationDialog.resx
LicenseUtilities.cs
LicenseResources.resx - set the following properties
Custom Tool: ResXFileCodeGenerator
Custom Tool Namespace: Infralution.Licensing.Forms
For simple Encrypted Licensing include:

EncryptedLicenseInstallForm.cs
EncryptedLicenseInstallForm.resx

Then I did the following:

Add Licensing Code to your Application
If you are evaluating ILS then you need to add a reference to one of following assemblies to your project:

Infralution.Licensing.Forms - for Windows Forms based applications and controls
Infralution.Licensing.WPF - for Windows Presentation Foundation (WPF) based applications and controls
Infralution.Licensing.ASP - for ASP.NET applications and components
Infralution.Licensing.CF - for Compact Framework applications and components
These assemblies contain the same core licensing classes but have different implementations of the user interface forms and dialogs. When you purchase ILS we will supply the full source code for these assemblies (for both C# and VB) which will allow you to incorporate the relevant classes directly into your own DLL or EXE eliminating the need for this reference.

Paste the LICENSE_PARAMETERS String (that we generated earlier) into your code as shown in the examples below. Change the value of _licenseFile constant to specify a unique location for your product's license file. Change the "MyEvaluationPassword" string to a unique value for your product. Note that this password is only used to generate the hidden location for the evaluation data stored on the user's computer - you should NOT use the product password here.

The actual code that does the license check is very simple. First, create an instance of the EncryptedLicenseProvider class or AuthenticatedLicenseProvider class (for AuthenticatedLicenses), then call the GetLicense method to get the installed license (if any) from the given file using the validation parameters. If there is no installed license then this method returns null (or Nothing in VB).

Encrypted Licensing Example
This example demonstrates the typical usage of the EncryptedLicenseProvider class to license an application. The application creates an instance of the EncryptedLicenseProvider and uses the GetLicense()()() method to check for an installed license. If there is no valid installed license the EvaluationDialog is displayed. This dialog allows the user to either continue their evaluation (if the trial period has not expired), exit the application or install a license using the EncryptedLicenseInstallForm. The VB.NET code uses the VB.NET application framework. The MyApplication class was created by clicking on the View Application Events button in the Project Properties page.

CopyC#
using System;
using System.Windows.Forms;
using Infralution.Licensing.Forms;
namespace LicensedApp_CS

I opened the project and started the application. It started without requiring registration.

What do I need to do?

Thanks,
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Feb 21, 2012 11:29 pm    Post subject: Reply with quote

I assume you are using C#? Can you maybe post the code from your Main() method to the forum to assist us in seeing exactly what you have implemented. I would suggest stepping through your main method to see what is occurring.

If you haven't changed the license file location or the product passwords from those supplied in the sample applications then it is possible that your application is simply finding the existing sample application license (if you had run the sample previously and installed a license).

Typically when creating your own products you need to create a new Product in License Tracker, provide a different Product Password and Authentication Password and generate the LICENSE_PARAMETERS to paste into your code. In your code you should also change the location of the license file to somewhere unique for your product.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Dovberman



Joined: 21 Feb 2012
Posts: 13
Location: Biloxi, MS

PostPosted: Wed Feb 22, 2012 12:23 am    Post subject: Reply with quote

I found out what I was doing wrong.

Changed code as follows:

namespace HoldemMyWay

{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///

/// <summary>
/// License Validation Parameters copied from License Tracker
/// </summary>
private const string LICENSE_PARAMETERS =
@"<EncryptedLicenseParameters>
<ProductName>My Product</ProductName>

====
Now it works.

Thanks,
Back to top
View user's profile Send private message Send e-mail 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