Download the file from the link in the application application for the WPF browser

How to download a file from the link to the WPF Browser Application, I use the NavigationService.Navigate method (http://www.google.com/docs/Arquivo.xlsx). The download window for loading opens, but after that the download is completed or canceled I can’t but enter the page navigation using the NavigationService.Navigate method, I noticed that the Content Property for NavigationService is null when I go to the file path, someone know , what's happening?

+3
source share
1 answer

I don’t understand what your goals are.

If you need to download a file, it is better to use WebRequest rather than NavigationService:

        var request = WebRequest.Create("http://www.farmanager.com/files/Far20b1777.x86.20110108.msi");
        using (var stream = request.GetResponse().GetResponseStream())
        {
            using (var reader = new StreamReader(stream))
            {
                var fileContent = reader.ReadToEnd();
            }
        }
+1
source

Source: https://habr.com/ru/post/1786911/


All Articles