CSharp examples for Operating System:Browser
Reads path of default browser from registry
using Microsoft.Win32; public class Main{ /// <summary> /// Reads path of default browser from registry /// </summary> /// <returns></returns> internal static string GetDefaultBrowserPath() {/*from ww w . ja v a2s .co m*/ try { string key = @"htmlfile\shell\open\command"; RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(key, false); // get default browser path return ((string)registryKey.GetValue(null, null)).Split('"')[1]; } catch { return "iexplore"; } } }