C# Copy URL when it changes

Viewed 79

I have a Windows form application with a browser added in. I would like it so when the URL changes, say when navigating to a new page, that it copies the new URL. How can I achieve this?

Searched everywhere with no results.

1 Answers

You could achieve this with the Navigated Event.

// Navigated event
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
    string url = webBrowser1.Url.ToString();
    //COPY THE URL HERE HOWEVER YOU LIKE
}
Related