Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change URL of WebBrowser in C#

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 implicitly 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?

like image 766
Sean Avatar asked Dec 08 '25 20:12

Sean


1 Answers

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.

like image 121
Sean Avatar answered Dec 10 '25 10:12

Sean



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!