Bloom.web.ExternalLinkController.TryGetDefaultBrowserPathWindowsOnly C# (CSharp) Method

TryGetDefaultBrowserPathWindowsOnly() private static method

private static TryGetDefaultBrowserPathWindowsOnly ( string &defaultBrowserPath ) : bool
defaultBrowserPath string
return bool
        private static bool TryGetDefaultBrowserPathWindowsOnly(out string defaultBrowserPath)
        {
            try
            {
                var key = @"HTTP\shell\open\command";
                using (var registrykey = Registry.ClassesRoot.OpenSubKey(key, false))
                    defaultBrowserPath = ((string)registrykey.GetValue(null, null)).Split('"')[1];
                return true;
            }
            catch
            {
                defaultBrowserPath = null;
                return false;
            }
        }