WinForm LinkLabel Open the specified site "Go"

Source: Internet
Author: User

At the weekend at home, just have time to write a small program, convenient conversion 2 binary, 8 and 16, which used a LinkLabel control, used to open my own blog, can not imagine how to read or find how to use this control to open the Web page. Supposedly LinkLabel control itself is a hyperlink, theoretically speaking should open a Web page is not a big problem, the results read a half-day book, incredibly did not write how to use. To think about it, if in aspx, naturally does not have this problem, but in WinForm, want to open the page is sure to call other programs, otherwise I draw a browser out. So I started looking for MSDN and saw that there was a process class in the System.Diagnostics namespace that was just for program interaction. This interaction involves opening (processing) The specified file using the specified program, or opening the specified Web page. The usage is also very simple:Private voidOpen_myurl (Objectsender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start ("http://catmao.blog.51cto.com");
}The practical meaning of this operation is to enter "cmd" in "Start"-"Run" and then enter "Start http://catmao.blog.51cto.com" on the command line. You can try it and open up my blog. As for what program is open, it is determined by the default browser settings on your computer. There is, of course, a way to refer to the namespace first and then use the class:usingSystem.Diagnostics;

Private voidOpen_myurl (Objectsender, LinkLabelLinkClickedEventArgs e)
{
Process.Start ("http://catmao.blog.51cto.com");
}

Original address:http://catmao.blog.51cto.com/1130511/286255

WinForm LinkLabel Open the specified site "Go"

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.