Label 超链接LinkLabel

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace 按钮 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // MessageBox.Show("大家好!"); Refresh(); } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start(@"C:\"); } private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("IExplore","http://www.baidu.com"); } } }
System.Diagnostics.Process.Start("IExplore","http://www.baidu.com");
System.Diagnostice命名空间的Process类的Start()方法用于打开文件夹或应用程序。