コード例 #1
0
        public async void FetchFile()
        {
            var data = await Fetcher.GetAllAsync();

            var prev     = data[0];
            var fileName = "deltaXML.zip";
            var version  = prev.VersionId.ToString();

            if (!Directory.Exists(version))
            {
                Directory.CreateDirectory(version);
            }


            var client = new RenewableClient(Path.Combine(version, fileName), prev.FiasDeltaXmlUrl);

            client.BlockComplete += (s, e) => Debug.WriteLine($"Downloaded: {e.Received:N}");
            client.Download();

            ;
        }
コード例 #2
0
        /// <summary>
        /// Скачивание файла с информации о файлах
        /// </summary>
        /// <param name="fi">Информация о скачивании</param>
        /// <param name="file">Куда сохранять</param>
        public static void GetXmlDelta(DownloadFileInfo fi, string file)
        {
            var rcl = new RenewableClient(file, fi.FiasDeltaXmlUrl);

            rcl.Download();
        }