Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false); if (key == null) { key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false); }
在极少数机器上,这是空白的。探测 regedit 时,发现键是(未找到值)。我有哪些选择?
我假设您想在默认浏览器中启动一个网站:
string url = "http://server.com"; Process.Start(url);
会做的。
我需要
if (key == null || key.ValueCount == 0) { key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false); }