Exemple #1
0
        private string TryFetchUserIdFromRegistry()
        {
            if ((_windowsRegistry.GetValueForCurrentUser(UserIdRegistryPath, UserIdRegistryValueName, null)
                 is string uniqueUserIdString))
            {
                if (Guid.TryParseExact(uniqueUserIdString, "B", out var parsedGuid))
                {
                    return(parsedGuid.ToString());
                }
            }

            return(null);
        }