楼上的方法只能用IE打开地址,E损坏,或者没装IE浏览器就杯具了。
直接 Process.Start("你要打开的网址")
此方法将会用 用户的默认浏览器打开地址。符合用户的浏览习惯,代码也简练!何乐不为?
直接 Process.Start("你要打开的网址")
此方法将会用 用户的默认浏览器打开地址。符合用户的浏览习惯,代码也简练!何乐不为?
补充回答: Process.Start("
http://www.baidu.com");
========================
C#的winform实现超级链接方法:
在窗体中拉一linkLabel控件,设置相关属性
在该控件下的linkLabel1_LinkClicked事件代码如下 :
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process myProcess = new Process();
myProcess.StartInfo.FileName = "iexplore.exe";
myProcess.StartInfo.Arguments = "http://www.cn-web.com";
myProcess.Start();
}
在窗体中拉一linkLabel控件,设置相关属性
在该控件下的linkLabel1_LinkClicked事件代码如下 :
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process myProcess = new Process();
myProcess.StartInfo.FileName = "iexplore.exe";
myProcess.StartInfo.Arguments = "http://www.cn-web.com";
myProcess.Start();
}