Open the given URL in a browser. - CSharp Operating System

CSharp examples for Operating System:Browser

Description

Open the given URL in a browser.

Demo Code


using System.Diagnostics;
using System;/*  w ww .j  a v  a  2  s . c  o m*/

public class Main{
        /// <summary>
        /// Open the given URL in a browser.
        /// </summary>
        public static bool Open(string url)
        {
            try
            {
                Process.Start(url);
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
}

Related Tutorials