我使用DownloadFile测试了一下,
Network.DownloadFile("http://aaa.bbb.com/update/update.txt", "c:\update.txt")
下载update.txt返回这样的内容
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.21.6</center>
</body>
</html>
应该是nginx里做了转发到https导致的。网上查了一下,需要直接使用https,DownloadFile默认情况下使用https会出错,这样用就正常了
Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls11
Network.DownloadFile("https://aaa.bbb.com/update/update.txt", "c:\update.txt")
于是测试了一下升级这样用:
Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls11
Syscmd.Project.Update()
结果可以正常升级,楼主试试