我通常通过参考下载一个项目,请参阅屏幕截图
但我想知道如何使用 octokit.net 进行编程并保存到本地磁盘:
- 以“zip”格式保存?
- 还是解压格式?
我尝试使用代码,但创建了一个空存档“* .zip”
var latestAsset = await client.Repository.Get("Ryozuki", "HelperBot");
//Download Release.zip here
var response = await client.Connection.Get<object>(new Uri(latestAsset.Url),
new Dictionary<string, string>(), null);
byte[] bytes = Encoding.ASCII.GetBytes(response.HttpResponse.Body.ToString()); ;
File.WriteAllBytes("RyozukiHelperBot.zip", bytes);