tofutim
tofutim

Reputation: 23374

If StartMenuInternet is not set, where else can I look for the default browser?

key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
if (key == null)
{
    key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
}

On a very few machines this is coming up blank. When regedit is probed, the key is found to be (value not found). What are my options?

Upvotes: 1

Views: 271

Answers (2)

tofutim
tofutim

Reputation: 23374

I needed

if (key == null || key.ValueCount == 0)
                {
                    key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false);
                }

Upvotes: 0

Michael Kennedy
Michael Kennedy

Reputation: 3380

I'm assuming you want to launch a website in the default browser:

string url = "http://server.com";
Process.Start(url);

will do it.

Upvotes: 4

Related Questions