コード例 #1
0
        public byte[] Activate(byte[] license)
        {
            string version = ConfigurationManager.AppSettings["Version"];
            string intelliLockDatabasePassword = ConfigurationManager.AppSettings["IntelliLockDatabasePassword"];

            string releasesDirectory            = AppDomain.CurrentDomain.GetData("Releases").ToString();
            string intelliLockDatabaseDirectory = releasesDirectory + "Databases\\SimpleSqliteUtilityLicenses.ildb";
            string intelliLockProjectDirectory  = releasesDirectory + version + "\\Utility\\IntelliLockProject\\IntelliLockProject.ilproj";


            List <string> licenseValidationChecks = new List <string>();

            licenseValidationChecks.Add("Customer");
            licenseValidationChecks.Add("FirstName");
            licenseValidationChecks.Add("LastName");

            IntelliLockManager.LicenseManager licenseManager = new IntelliLockManager.LicenseManager();
            licenseManager.ValidateUtilityLicense(license, intelliLockProjectDirectory, intelliLockDatabaseDirectory, intelliLockDatabasePassword, licenseValidationChecks);

            return(null);
        }
コード例 #2
0
        private IntelliLockManager.License CreateLicenseFile(string projectTypeFolderName, Dictionary <string, string> licenseInformationKeyValues)
        {
            string apiIntelliLockProjLocation = MapPath("~\\Releases\\" + version + "\\" + projectTypeFolderName + "\\IntelliLockProject\\IntelliLockProject.ilproj");
            string companyOrDeveloperName     = string.Empty;

            if (Request.Form.AllKeys.Contains("Company or Developer Name"))
            {
                companyOrDeveloperName = Request.Form["Company or Developer Name"].Trim();
            }
            else
            { /*throw error and email my account from the catch*/
            }


            IntelliLockManager.LicenseManager licenseManager = new IntelliLockManager.LicenseManager();
            IntelliLockManager.License        license        = licenseManager.CreateLicense(apiIntelliLockProjLocation, licenseInformationKeyValues);


            if (license.LicenseFile == null)
            { /*throw error and email my account from the catch*/
            }

            return(license);
        }