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"