If TryConnectHost("www.qq.com") Then '看看域名能否能解释
Network.DownloadFile("http://111.11.1.60:8080/down/Version.txt", "D:\UpdateTemporary\Version.txt")
End If
Dim utmp As String = "D:\UpdateTemporary" '存放升级文件的临时文件夹
Dim cver As Date = FileSys.ReadAllText(ProjectPath & "\Catch\Version.txt") '客户端Version.txt
Dim uvtxt As String = utmp & "\Version.txt" '服务端版本
Dim sver As Date = FileSys.ReadAllText(uvtxt) '服务器Version.txt
If FileSys.DirectoryExists(utmp) = False Then
MessageBox.Show("下载效验版本失败")
Return
ElseIf sver > cver Then '如果服务器版本大于客户端版本
MessageBox.Show("提示:软件将会重新下载到桌面,请把旧版本删除")
Network.DownloadFile("http://111.11.1.60:8080/down/eg.zip", SpecialFolder.DesktopDirectory & "\eg.zip" ,"" ,"" ,True, 100000, True) '将软件下载到桌面
End If
FileSys.DeleteDirectory(utmp,2,2) '删除临时文件夹
Return '终止执行后续代码,直接退出