Пример #1
0
        public static DetectedLicense FindLicense()
        {
            var sources = LicenseSource.GetStandardLicenseSources().ToArray();
            var result  = ActiveLicense.Find("ServiceControl", sources);

            var detectedLicense = new DetectedLicense("HKEY_LOCAL_MACHINE", LicenseDetails.FromLicense(result.License));

            detectedLicense.IsEvaluationLicense = string.Equals(result.Location, "Trial License", StringComparison.OrdinalIgnoreCase);

            return(detectedLicense);
        }
        public static DetectedLicense FindLicense()
        {
            var sources = new LicenseSource[]
            {
                new LicenseSourceFilePath(GetMachineLevelLicenseLocation())
            };

            var result = ActiveLicense.Find("ServiceControl", sources);

            var detectedLicense = new DetectedLicense(result.Location, LicenseDetails.FromLicense(result.License));

            detectedLicense.IsEvaluationLicense = string.Equals(result.Location, "Trial License", StringComparison.OrdinalIgnoreCase);

            return(detectedLicense);
        }