开发者

How do I launch the default browser with a web page?

开发者 https://www.devze.com 2023-01-30 02:59 出处:网络
I\'d like to launch a web browser to visit a location in google maps开发者_如何学Python from my C++/CLI .net program. What\'s the simplest way to launch the users current default browser?I got it from

I'd like to launch a web browser to visit a location in google maps开发者_如何学Python from my C++/CLI .net program. What's the simplest way to launch the users current default browser?


I got it from another post in stackoverflow

Process.Start( 
    new ProcessStartInfo() 
    { 
        FileName = "cmd.exe", 
        Arguments = "/c start http://www.google.com", 
        WindowStyle = ProcessWindowStyle.Hidden, 
        UseShellExecute = false 
    }); 


On .NET, use Process.Start.

On VC++, VB, use ShellExecute.


This is the simple approach I found after some more extensive googling:

System::Diagnostics::Process::Start("http://maps.google.com/");

Cheers for the input all.

0

精彩评论

暂无评论...
验证码 换一张
取 消