key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
if (key == null)
{
key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
}
在很少的机器上,这是空白的。当探测到regedit时,发现密钥是(未找到值)。我有什么选择?
答案 0 :(得分:4)
我假设您要在默认浏览器中启动网站:
string url = "http://server.com";
Process.Start(url);
会这样做。
答案 1 :(得分:0)
我需要
if (key == null || key.ValueCount == 0)
{
key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
}