开发者

Change URL of WebBrowser in C#

开发者 https://www.devze.com 2023-02-02 13:26 出处:网络
I am designing a simple application using c# and it has a web browser in it. I need to either (preferably) refresh the page that is currently inside the broswer, or navigate to a \"new\" url. I tried

I am designing a simple application using c# and it has a web browser in it. I need to either (preferably) refresh the page that is currently inside the broswer, or navigate to a "new" url. I tried Browser.Url = new Uri("http://www.pandora.com/"); but I get an error when I try to compile it.

Error 1 Cannot implicitl开发者_如何学编程y convert type 'string' to 'System.Uri' c:\users\sean\documents\visual studio 2010\Projects\Pandora\Pandora\Form1.cs 51 27 Pandora

What am I doing wrong?


For some reason, it wanted me to write it like this:

Browser.Url = new System.Uri("https://www.pandora.com/", System.UriKind.Absolute);

This works so thats good.

0

精彩评论

暂无评论...
验证码 换一张
取 消