How to change home page in Internet Explorer using C#?

后端 未结 5 1810
感情败类
感情败类 2021-01-13 08:28

Is it possible to change home page in Internet Explorer in C# application? Solution for other browsers (Firefox, Chrome) would be also nice.

5条回答
  •  不知归路
    2021-01-13 08:46

    The home page for Internet Explorer is held in the Start Page registry key at HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main (according to this), so you can set it using the Registry class in Microsoft.Win32 (from this example):

    RegistryKey startPageKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);
    startPageKey.SetValue("Start Page", "http://stackoverflow.com");
    startPageKey.Close();
    

    Don't know about the others, I'm afraid.

提交回复
热议问题