Good day. I am working on a file downloader using DownloadFileAsync. In normal situations, everything works fine. But when I download a file and disconnect the network connection, downloading progress is just stopping for an infinite time, without attracting any errors or calling any callbacks. Any ideas how to handle this situation? Many thanks.
_client.Proxy = WebRequest.DefaultWebProxy; _client.DownloadProgressChanged += (sender, argv) => { actionCallback(argv.ProgressPercentage); } _client.DownloadFileCompleted += (sender, argv) => { if (argv.Error != null) { _exc = argv.Error; } set event } Task.Factory.StartNew(() => { _client.DownloadFileAsync(request, targetFileName); thread sync if (_exc != null) { logger.ErrorException(exc); throw; }
The problem occurs under Vista and 2k8. On Win7, everything is in order.
rapt0r
source share