예제 #1
0
 public Downloader(IView view)
 {
     _view = view;
     _options = new HttpDownloaderOptions("GET",
                                          Settings.Default.Timeout,
                                          Settings.Default.RangeFrom,
                                          Settings.Default.RangeTo,
                                          Settings.Default.ProxyUri,
                                          Settings.Default.ProxyPort);
 }
예제 #2
0
        private HttpWebResponse GetHttpResponse(string url, HttpDownloaderOptions options)
        {
            var request = CreateRequestInternal(url);

            if (options.RangeFrom != 0L && options.RangeTo != 0L)
            {
                options.DownloadMode = DownloadMode.DownloadRange;
                request.AddRange((int) options.RangeFrom, (int) options.RangeTo);
            }
            else
            {
                options.DownloadMode = DownloadMode.Append;
                request.AddRange((int) options.RangeFrom);
            }

            return GetResponseInternal(request);
        }
예제 #3
0
 public HttpDownloader(string url, HttpDownloaderOptions options)
 {
     WebFactory = new WebFactory {Options = options};
     InitCreateResponse(url);
 }
예제 #4
0
 public WebFactory()
 {
     Options = new HttpDownloaderOptions("GET", Timeout);
 }