question

corehacked-3103 avatar image
0 Votes"
corehacked-3103 asked JohnWriter-6447 published

How to grab the current url from WebView2 | C# Windows Forms

How would I go about grabbing the current webView2 Url?

I would like to display it in the search box at the top of my form/make it a string.

I just need the code snippet of how to get the current URL the rest I can do myself / displaying it into a text box and updating etc.

dotnet-csharpwindows-forms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
1 Vote"
Castorix31 answered JohnWriter-6447 published

I get it with just :

 string sURL = webView21.Source.ToString();
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks man you helped me a lot

1 Vote 1 ·