How does one load a URL from a .NET client application

最后都变了- 提交于 2019-12-24 00:49:07

问题


What is the preferred way to open a URL from a thick client application on Windows using C# and the .NET framework? I want it to use the default browser.


回答1:


The following code surely works:

Process.Start("http://www.yoururl.com/Blah.aspx");

It opens the default browser (technically, the default program that handles HTTP URIs).




回答2:


I'd use the Process.Start method.

Process.Start("http://www.google.com/");



回答3:


private void launchURL_Click(object sender, System.EventArgs e){
 string targetURL = "http://stackoverflow.com";
 System.Diagnostics.Process.Start(targetURL);
}



回答4:


System.Diagnostics.Process.Start("http://www.stackoverflow.com");


来源:https://stackoverflow.com/questions/93832/how-does-one-load-a-url-from-a-net-client-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!