Esempio n. 1
0
        public void Load()
        {
            if (RuntimeContext.CurrentContext == RtContextValue.NCACHE)
            {
                try
                {
                    string USER_KEY = RegHelper.ROOT_KEY + @"\UserInfo";
                    _companyName = (string)RegHelper.GetRegValue(USER_KEY, "company", 0);
                }
                catch
                {
                }
            }


            if (RuntimeContext.CurrentContext == RtContextValue.NCACHE)
            {
                try
                {
                    string USER_KEY = RegHelper.ROOT_KEY + @"\UserInfo";
                    _firstName      = (string)RegHelper.GetRegValue(USER_KEY, "firstname", 0);
                    _lastName       = (string)RegHelper.GetRegValue(USER_KEY, "lastname", 0);
                    _registeredName = _firstName + " " + _lastName;
                }
                catch
                {
                }
            }


            if (RuntimeContext.CurrentContext == RtContextValue.NCACHE)
            {
                try
                {
                    string USER_KEY = RegHelper.ROOT_KEY + @"\UserInfo";
                    _email = (string)RegHelper.GetRegValue(USER_KEY, "email", 0);
                }
                catch
                {
                }
            }


#if NETCORE
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                try
                {
                    RegUtil.LoadRegistry();
                    _companyName    = RegUtil.LicenseProperties.UserInfo.Company;
                    _email          = RegUtil.LicenseProperties.UserInfo.Email;
                    _firstName      = RegUtil.LicenseProperties.UserInfo.FirstName;
                    _lastName       = RegUtil.LicenseProperties.UserInfo.LastName;
                    _registeredName = _firstName + " " + _lastName;
                }
                catch (Exception) {}
            }
#endif
        }
Esempio n. 2
0
 public static void ReadActivationCode(StringBuilder code, short prodId)
 {
     //            if (RegUtil.LicenseProperties == null || RegUtil.LicenseProperties.UserInfo == null)
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         UnManagedNCLicense.ReadActivationCode(code, prodId);
     }
     else
     {
         RegUtil.LoadRegistry();
         NCCryptoCode.Decode(RegUtil.LicenseProperties.UserInfo.AuthCode, code);
     }
 }
Esempio n. 3
0
 public void PopulateUserProfile()
 {
     try
     {
         RegUtil.LoadRegistry();
         _userProfile.Company   = RegUtil.LicenseProperties.UserInfo.Company;
         _userProfile.Email     = RegUtil.LicenseProperties.UserInfo.Email;
         _userProfile.FirstName = RegUtil.LicenseProperties.UserInfo.FirstName;
         _userProfile.LastName  = RegUtil.LicenseProperties.UserInfo.LastName;
     }
     catch (Exception e)
     {
         NCacheServiceLogger.LogError($"Error occurred during PopulateUserProfile(). {e}");
     }
 }
Esempio n. 4
0
 public static void ReadInstallCode(StringBuilder s, short productId)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         UnManagedNCLicense.ReadInstallCode(s, productId);
     }
     else
     {
         if (!string.IsNullOrEmpty(_installCode))
         {
             s.Append(_installCode);
             return;
         }
         RegUtil.LoadRegistry();
         var installCode = RegUtil.GetInstallCode();
         NCCryptoCode.Decode(installCode, s);
         _installCode = s.ToString();
     }
 }