How C # calls the default browser to open URLs

Source: Internet
Author: User

One

        Private voidButton1_Click (Objectsender, EventArgs e) {            //read the default browser executable file path from the registryRegistryKey key = Registry.ClassesRoot.OpenSubKey (@"http\shell\open\command\"); strings = key. GetValue ("").            ToString (); //S is your default browser, but with the parameters behind it, cut it, but note that the parameters behind the different browsers are not the same! //"D:\Program Files (x86) \google\chrome\application\chrome.exe"--"%1"System.Diagnostics.Process.Start (S.substring (0, S.length-8),"http://blog.csdn.net/testcs_dn"); }

Two

        Private void button2_click (object  sender, EventArgs e)        {            //             System.Diagnostics.Process.Start ("explorer.exe""/http BLOG.CSDN.NET/TESTCS_DN");        }

Three

        Private void button3_click (object  sender, EventArgs e)        {            //             System.Diagnostics.Process.Start ("http://blog.csdn.net/testcs_dn");        }

Four

        Private void button4_click (object  sender, EventArgs e)        {            // call IE browser              System.Diagnostics.Process.Start ("iexplore.exe""  HTTP://BLOG.CSDN.NET/TESTCS_DN");        }

How C # calls the default browser to open URLs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.