Pieter Breed
Pieter Breed

Reputation: 5689

How do you launch a URL in the default browser from within a winmobile application?

In normal C# desktop apss, you can launch a URL by saying:

System.Diagnostics.Process.Start("http://www.stackoverflow.com")

but System.Diagnostics.Process on windows mobile doesn't seems have that string overload.

Upvotes: 0

Views: 357

Answers (3)

kgiannakakis
kgiannakakis

Reputation: 104198

This has worked for me in WindowsMobile:

try
{
    System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
    myProcess.StartInfo.UseShellExecute = true;
    myProcess.StartInfo.FileName = url;
    myProcess.Start();
}
catch (Exception e) {}

Upvotes: 1

Matthew Flaschen
Matthew Flaschen

Reputation: 284997

According to http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx , http://msdn.microsoft.com/en-us/library/d8fz649y.aspx , and http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.filename.aspx you should be able to do:

ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "http://www.stackoverflow.com";
Process.Start(psi);

However, I haven't tested this on CF.

Upvotes: 0

Johnno Nolan
Johnno Nolan

Reputation: 29657

Looks like this blog has your solution

http://www.businessanyplace.net/?p=code#startapp

It uses the CreateProcess call

Upvotes: 0

Related Questions