You are here: Articles > Programming > C-Csharp

 See more articles about "C-Csharp "

Open a URL in the Default Browser in Your .NET Application

 

Virtually every application these days requires at least some connection to the internet. Letting the user click a link and open it in their browser is essential. This recipe shows you the 1 line method of doing so.

This is the absolute simplest way to launch a URL in a .NET application:

System.Diagnostics.Process.Start("http://www.tech-recipes.com");



Just put this code in the click event for your control, and replace the URL in the sample code with your URL.

 

Also see ...

Make System Tray Based Application in .NET
H3Creating an application that lives in the system tray is easy, but it is not entirely obvious how to do so in Visual Studio. This recipe will show you the steps./H3P1) First, create a new Windows Application project in Visual Studio.NET. This can be either Visual Basic or C br / br /2)

Pause Output From a Command Line Application in .NET Debug Mode
H3If you are writing a command line application in .NET, you might notice that the application closes immediately if you haven't set a breakpoint. This recipe shows you the one line method to keep the application open so you can see the output./H3PTypically when you are writing to the console,

Get Web Page Contents in Code with C#
H3When you are developing an application that needs to access data stored on a web server, you can easily get the contents of a web page with this simple C function./H3PThe .NET framework provides a rich set of methods to access data stored on the web. First you will have to include the right