Last active
May 24, 2020 04:57
-
-
Save loic-sharma/50bd629a31abab9f45148fdf93d7ffaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
namespace ConsoleApp2 | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
using (var httpClient = new HttpClient()) | |
using (var packageStream = new MemoryStream()) | |
{ | |
using (var response = await httpClient.GetAsync("https://api.nuget.org/v3-flatcontainer/fantas.monogame/1.0.5/fantas.monogame.1.0.5.nupkg")) | |
using (var stream = await response.Content.ReadAsStreamAsync()) | |
{ | |
await stream.CopyToAsync(packageStream); | |
} | |
using (var zip = new ZipArchive(packageStream, ZipArchiveMode.Read, leaveOpen: true)) | |
{ | |
foreach (var entry in zip.Entries) | |
{ | |
Console.WriteLine(entry.FullName); | |
} | |
} | |
} | |
} | |
} | |
} |
This serious transgression has been resolved. Thanks for bringing it to my attention 😂
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's an extra space on line 13.