Label 超链接LinkLabel

View Code
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()方法用于打开文件夹或应用程序。

posted on 2013-05-13 10:04  杨柳清枫2012  阅读(276)  评论(0)    收藏  举报

导航