public async Task<string> DownloadAsync(Uri uri, ITransferProgress progress) {
     using (var tmpFile = new TmpFileCreated()) {
         await _downloader.DownloadAsync(uri, tmpFile.FilePath, progress).ConfigureAwait(false);
         return File.ReadAllText(tmpFile.FilePath.ToString());
     }
 }
 public string Download(Uri uri) {
     using (var tmpFile = new TmpFileCreated()) {
         _downloader.Download(uri, tmpFile.FilePath);
         return File.ReadAllText(tmpFile.FilePath.ToString());
     }
 }
 public string Download(Uri uri, ITransferProgress progress) {
     using (var tmpFile = new TmpFileCreated()) {
         _downloader.Download(uri, tmpFile.FilePath, progress);
         return File.ReadAllText(tmpFile.FilePath.ToString());
     }
 }
示例#4
0
 public async Task<byte[]> DownloadAsync(Uri uri) {
     using (var tmpFile = new TmpFileCreated()) {
         await _downloader.DownloadAsync(uri, tmpFile.FilePath).ConfigureAwait(false);
         return File.ReadAllBytes(tmpFile.FilePath.ToString());
     }
 }