Dim loc As String=updatepath
Dim uptime As Date
If FileSys.FileExists(loc & "\update.txt")=False Or FileSys.FileExists(loc & "\update2.zip")=False Or FileSys.FileExists(loc & "\update1.zip")=False Then
MessageBox.Show("无法连接到升级文件的文件夹,没有查找到升级文件,你的电脑可能掉线或不能登录公司G盘")
MessageBox.Show(loc & "\update.txt" & loc & "\update2.zip" & loc & "\update1.zip")
System.Diagnostics.Process.GetCurrentProcess().Kill
End If
Dim te As String = FileSys.ReadAllText(loc & "\update.txt")
te=te.Remove(te.IndexOf("|"))
uptime=CDate(te)
If uptime> PublishDate Then
If filesys.DirectoryExists(ProjectPath & "\UpdateTemporary") Then
FileSys.DeleteDirectory(ProjectPath & "\UpdateTemporary",2,2)
End If
Network.DownloadFile(loc & "\update2.zip",ProjectPath & "UpdateTemporary\update2.zip","","",True,20000,True)
Network.DownloadFile(loc & "\update1.zip",ProjectPath & "UpdateTemporary\update1.zip","","",True,20000,True)
Network.DownloadFile(loc & "\update.txt",ProjectPath & "UpdateTemporary\update.txt","","",True,20000,True)
If FileSys.FileExists(ProjectPath & "UpdateTemporary\update.txt") AndAlso FileSys.FileExists(ProjectPath & "UpdateTemporary\update2.zip") AndAlso FileSys.FileExists(ProjectPath & "UpdateTemporary\update1.zip") Then
UpdatePath = ProjectPath & "UpdateTemporary"
RemoteUpdate = False
Syscmd.Project.Update(False,True)
Return
Else
MessageBox.Show("下载升级文件异常,无法下载升级包,请尝试重启系统或者检查网络.")
System.Diagnostics.Process.GetCurrentProcess().Kill
End If
End If