This is what I am trying to do.
- Windows Form App loads with web browser
- Goes to a certain link
- Checks to see if the url bar is empty, if not it takes the current url and writes to a string and then navigates to some other url.
I keep getting Cannot implicitly convert type 'System.Uri' to 'string'
and I have tried a few things but can't get my head around it.
string url;
try
{
if (webBrowser1.Url != null)
{
// url = webBrowser1.Url;
MessageBox.Show("Success!");
}
else
{
MessageBox.Show(":(!");
}
}
catch
{
MessageBox.Show("Something Screwed Up");
}
Now at this point I get :( when I comment out the error. This is on form1.cs - should I be doing this on program.cs? It seems like the object may not be created a the point when I check but I have no idea. By default the form loads with a URL pre-loaded.