Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Interpreting a clicked link

I'm building a C# application that has an "About" box hanging off the help menu. In my about box I have put a rich edit control, and I'm writing a bunch of stuff into it: version numbers, copyright details, etc. I'm also putting a few clickable links in there: one pointing to my website, and one as a "mailto:" link to a support email address.

The rich edit is quite correctly recognising and highlighting the links, and when I click on them, it's giving them back to me in a LinkClicked event.

What I'd like to know is what I do with them now! I've got the URI (the web address or the mailto: address), but I can't seem to find a simple and generic way of firing off the appropriate application. Naturally, I want the web address to invoke the default browser and I want the "mailto:" to start a new mail message in the default mail client.

Is there a simple easy way I can do this within the .NET framework?

Andrew Lighten
Friday, January 30, 2004

You want to use:

System.Diagnostics.Process.Start( myLink );

Where myLink is something like "http://www.mysite.com" or "mailto:me@mysite.com". It'll fire off the app you're looking for.

John C
Friday, January 30, 2004

Excellent! Thanks very much, John.

Andrew Lighten
Friday, January 30, 2004

*  Recent Topics

*  Fog Creek Home