对不起,记错了,没有那么简单
以下是例子使用 LinkLabel 控件启动 Internet Explorer 并链接到 Web 页 将 Text 属性设置为适当的标题。
设置 LinkArea 属性以确定将标题的哪一部分指示为链接。
在 LinkClicked 事件处理程序中,将 LinkVisited 属性设置为 true,并使用 Process.Start 方法以某个 URL 启动默认浏览器。若要使用 Process.Start 方法,您需要向 System.Diagnostics 命名空间添加一个引用。
' Visual Basic
Protected Sub LinkLabel1_LinkClicked (ByVal Sender As Object, _
ByVal e As EventArgs)
' Change the color of the link text by setting LinkVisited
' to True.
LinkLabel1.LinkVisited = True
' Call the Process.Start method to open the default browser
' with a URL:
System.Diagnostics.Process.Start("http://www.Microsoft.com")
End Sub// C#
protected void LinkLabel1_LinkClicked(object sender, System.EventArgs e)
{
// Change the color of the link text by setting LinkVisited
// to True.
linkLabel1.LinkVisited = true;
// Call the Process.Start method to open the default browser
// with a URL:
System.Diagnostics.Process.Start("http://www.Microsoft.com");
}
以下是例子使用 LinkLabel 控件启动 Internet Explorer 并链接到 Web 页 将 Text 属性设置为适当的标题。
设置 LinkArea 属性以确定将标题的哪一部分指示为链接。
在 LinkClicked 事件处理程序中,将 LinkVisited 属性设置为 true,并使用 Process.Start 方法以某个 URL 启动默认浏览器。若要使用 Process.Start 方法,您需要向 System.Diagnostics 命名空间添加一个引用。
' Visual Basic
Protected Sub LinkLabel1_LinkClicked (ByVal Sender As Object, _
ByVal e As EventArgs)
' Change the color of the link text by setting LinkVisited
' to True.
LinkLabel1.LinkVisited = True
' Call the Process.Start method to open the default browser
' with a URL:
System.Diagnostics.Process.Start("http://www.Microsoft.com")
End Sub// C#
protected void LinkLabel1_LinkClicked(object sender, System.EventArgs e)
{
// Change the color of the link text by setting LinkVisited
// to True.
linkLabel1.LinkVisited = true;
// Call the Process.Start method to open the default browser
// with a URL:
System.Diagnostics.Process.Start("http://www.Microsoft.com");
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货