以下是引用bigpeng在2018/3/24 20:10:00的发言:
甜版,不好意思自动更新还是有问题,我在自己电脑上测试成功,但是在别的电脑上测试提示:对路径D:/temp的访问被拒绝,不知是什么原因
试试改成这样
try
UpdatePath = "ftp://bigpeng:Aa123456@47.96.7.165/Update/"
Network.DownloadFile(updatePath & "update.txt", projectPath & "temp/update.txt" ,"" ,"" ,True, 100000, True) '下载update.txt文件
Dim ud() As String = FileSys.ReadAllText(projectPath & "temp/update.txt").Split("|") '获取文件内容
Dim Sdate1 As Date = Cdate(ud(0)) '服务器update.txt发布日期
Dim Sdate2 As Date = Cdate(ud(1)) '服务器Version.txt发布日期
Dim Cdate1 As Date = PublishDate '客户端发布日期
Dim Cdate2 As Date = FileSys.ReadAllText(ProjectPath & "\Bin\Version.txt") '客户端Version.txt发布日期
If Sdate2 > Cdate2 Then
msgbox("大版本")
Network.DownloadFile(updatePath & "update2.zip", projectPath & "temp/update2.zip" ,"" ,"" ,True, 100000, True)
UpdatePath = projectPath & "temp/"
Syscmd.Project.Update(False,False)
ElseIf Sdate1 > Cdate1 Then
msgbox("小版本")
Network.DownloadFile(updatePath & "update1.zip", projectPath & "temp/update1.zip" ,"" ,"" ,True, 100000, True)
UpdatePath = projectPath & "temp/"
Syscmd.Project.Update(False,False)
End If
catch ex As exception
msgbox(ex.message)
msgbox("下载失败")
End try