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 }
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); } }
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}"); } }
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(); } }