WinForm Invoking the browser

Source: Internet
Author: User

Method 1:Private voidButton1_Click (Objectsender, EventArgs e) Geneva. {  Geneva.//read the default browser executable file path from the registryGeneva. RegistryKey key = Registry.ClassesRoot.OpenSubKey (@"http\shell\open\command\");  to.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" the. System.Diagnostics.Process.Start (S.substring (0, S.length-8),"http://blog.csdn.net/testcs_dn"); Ten.} Method 2:Private voidButton2_Click (Objectsender, EventArgs e) Geneva. {  Geneva.//invoking the system's default browserGeneva. System.Diagnostics.Process.Start ("Explorer.exe","http://blog.csdn.net/testcs_dn");  to.} Method 3:Private voidButton3_Click (Objectsender, EventArgs e) Geneva. {  Geneva.//invoking the system's default browserGeneva. System.Diagnostics.Process.Start ("http://blog.csdn.net/testcs_dn");  to.} Method 4:Private voidButton4_Click (Objectsender, EventArgs e) Geneva. {  Geneva.//Call IE browserGeneva. System.Diagnostics.Process.Start ("Iexplore.exe","http://blog.csdn.net/testcs_dn");  to.}

Original address: http://blog.csdn.net/testcs_dn/article/details/42246969#

WinForm Invoking the browser

Related Article

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.