c# - C# 从 github 下载文件
问题描述
我创建了一个自动更新的程序,通过从 github 下载更新的版本。但是程序一直在下载网页的源 html 而不是程序。我使用的链接是https://github.com/PoH98/MyBot.Supporter/raw/master/MyBot.Supporter.Main.exe并假设所有浏览器都会下载该 exe。但是当我使用 WebClient 进行下载时,它下载了https://github.com/PoH98/MyBot.Supporter/blob/master/MyBot.Supporter.Main.exe源 HTML 代码!我的代码在这里:
WebClient wc = new Webclient();
wc.Downloadfile("https://github.com/PoH98/MyBot.Supporter/raw/master/MyBot.Supporter.Main.exe","Update");
File.Delete("MyBot.Supporter.Main.exe");
File.Move("Update","MyBot.Supporter.Main.exe");
我做错了吗?
解决方案
推荐阅读
- javascript - 搜索文本的突出显示问题 - React Native
- python - BeautifulSoup 将多个标签 .text 分配给变量
- loops - 重现 R 中的特定图形
- python - 函数作为参数与循环时间共性
- excel - excel在表格中查找索引,在原点中搜索任何数字并在目标表格中匹配
- scala - 如何使用 Circe 为 Either 类型创建解码器?
- javascript - 如何在 Angular 8 中添加冰沙图表
- git - 在 release/v4.2 SDK 中构建 aws_iot(事物影子)示例时出错
- opengl - 如何解决“无 SOI”的 stbi_load 错误?
- r - 根据 r 中的行号替换值