LinkLabel如何实现URL超链接,链接到一个网页?

解决方案 »

  1.   

    属性LinkArea
    Start 链接开始的字符的位置
    Lengh 字符数
      

  2.   

    然后监视LinkClicked事件,加入打开链接的代码
      

  3.   

    LinkClicked事件System.Diagnostics.Process.Start("网址");
      

  4.   

    调用系统API的方法using System.Runtime.InteropServices; [DllImport("shell32.dll", EntryPoint="ShellExecute", CharSet=CharSet.Auto)]
    public static extern int ShellExecute(IntPtr hwnd,string lpOperation,string lpFile,string lpParameters,string lpDirectory,int nShowCmd);// 调用 textBox1.Text 要访问的URL
    Long lngReturn= ApiCalls.ShellExecute(Form.ActiveForm.Handle,"Open",textBox1.Text,"","",1);