C#:从Windows应用程序内部启动URL [英] C#: Launch URL from inside a windows application

查看:158
本文介绍了C#:从Windows应用程序内部启动URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我是C#的新手,想知道是否有人可以提供从Windows窗体中启动默认网站的示例代码?我有一个带有各种按钮的用户窗体.我想单击一个按钮,然后启动所需的Intranet网站.我在网上闲逛,这就是我发现的东西:-

I am new to C#, and was wondering if someone could provide sample code for launching a default website from within a windows form? I have a userform with various buttons. I would like to click on a button and then launch the desired intranet website. I poked around the web and this is what I have found:-

 

私人 void button8_Click( object 发件人 EventArgs e)

Private void button8_Click(object sender, EventArgs e)

{

字符串 targetURL = @http: //www .duncanmackenzie.net;

string targetURL = @http://www.duncanmackenzie.net;

System.Diagnostics. 处理 .Start(targetURL);

System.Diagnostics.Process.Start(targetURL);

}

非常感谢您的帮助.

 

 

推荐答案

你好,

您希望如何实施?

您是否正在表单中使用浏览器控件(将在您的应用程序中打开网络浏览器)

Are you using a browser control in your form (a web browser will open within your application)

还是要使用最终用户浏览器(表单将使用外部浏览器)?

Or are you wanting to use the end-users browser (form will use external browser)?


这篇关于C#:从Windows应用程序内部启动URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆