Exemplo n.º 1
0
            public DownloadAsyncTracker(IWebProxy proxy, string url)
            {
                // Init
                this.ProgressPercentage             = 0;
                this.DownloadDataCompletedEventArgs = null;

                // Start the download
                wc       = new WebClientWithCompression();
                wc.Proxy = proxy;
                wc.DownloadProgressChanged += this.wc_DownloadProgressChanged;
                wc.DownloadDataCompleted   += this.wc_DownloadDataCompleted;
                wc.DownloadDataAsync(new Uri(url));
            }
Exemplo n.º 2
0
            public DownloadAsyncTracker(string url)
            {
                // Init
                ProgressPercentage             = 0;
                DownloadDataCompletedEventArgs = null;

                // Start the download
                wc       = new WebClientWithCompression();
                wc.Proxy = Configuration.Proxy;

                wc.DownloadProgressChanged += wc_DownloadProgressChanged;
                wc.DownloadDataCompleted   += wc_DownloadDataCompleted;

                // same headers as sent by modern Chrome.
                // Gentlemen, start your prayer wheels!
                wc.Headers.Add("Cache-Control", "no-cache");
                wc.Headers.Add("Pragma", "no-cache");
                wc.Headers.Add("User-agent", Configuration.WebUserAgent);

                wc.DownloadDataAsync(new Uri(url));
            }