最近想写一个修改浏览器首页的程序,我的思路是修改注册表HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Main\StartPage的键值来修改IE首页,代码如下
        public void WTRegedit()
        {
            RegistryKey hkml = Registry.LocalMachine;
            RegistryKey SOFTWARE = hkml.OpenSubKey("SOFTWARE", true);
            RegistryKey Microsoft = SOFTWARE.OpenSubKey("Microsoft", true);
            RegistryKey InternetExplorer = Microsoft.OpenSubKey("Internet Explorer", true);
            RegistryKey Main = InternetExplorer.OpenSubKey("MAIN", true);
            Main.SetValue("Start Page", "www.dayenet.com");
        }
可是还是没有...
求教!!!

解决方案 »

  1.   

    RegistryKey hkml = Registry.LocalMachine;这个不对吧?是当前用户的那个键试试
      

  2.   

    HKEY_CURRENT_USER
    RegistryKey hkml = Registry.LocalMachine;不是一个键!!!
      

  3.   


     网页上设为首页 和收藏夹
      <area shape="rect" coords="843, 10, 905, 33" href="#" 
                        onclick="homePage.SetHomePage(document.location.href);" />
                    <area shape="rect" coords="907, 10, 971, 32" href="#" 
                        onclick="Hotsales.AddFavorite(document.title);" />