Get URL from C# Web View

Asked 2 years ago, Updated 2 years ago, 45 views

I want to create a C# webview and automatically receive the URL as a string whenever the web page changes in the webview.

What should I do? ㅠ<

c#

2022-09-22 21:33

1 Answers

In webview, WebView.LoadCompleted event occurs.

Implement LoadCompletedEventHandler delegate to handle the event.

This is the example code shown in the link above.

WebView1.LoadCompleted += new Windows.UI.Xaml.Navigation.LoadCompletedEventHandler(WebView1_LoadCompleted);

//...Optimized

void WebView1_LoadCompleted(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
{
    String uri = e.Uri.ToString();
}


2022-09-22 21:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.