strRemoteFile = "/升级文件/" & dr("文件名")
strLocalFile = Vars("_gsTempPath") & "\" & dr("文件名")
If filesys.FileExists(strLocalFile) Then filesys.DeleteFile(strLocalFile,2,2)
Dim ftp1 As new ftpclient
ftp1.host = Vars("_gsFtpHostAdmin")
ftp1.Account = Vars("_gsFtpAccountAdmin")
ftp1.Password = Vars("_gsFtpPasswordAdmin")
ftp1.UTF8 = True
If ftp1 Is Nothing Then Return False
If ftp1.Connected = False Then ftp1.Connect
If ftp1.FileExists(strRemoteFile) Then
msgbox(ftp1.Connected) 报True
msgbox(strRemoteFile) 报/升级文件/升级包20181202.zip
msgbox(strLocalFile) 报F:\编程\xxx管理系统\Publish\project\temp\升级包20181202.zip
If ftp1.Download(strRemoteFile,strLocalFile) = False Then
msgbox(ftp1.Connected) 报False
MessageBox.show("升级包下载失败!","提示",MessageboxButtons.Ok,MessageboxIcon.Information) 报升级包下载失败
ftp1.close
Return False
End If
Else
MessageBox.show("下载失败,升级文件包不存在!","提示",MessageboxButtons.Ok,MessageboxIcon.Information)
ftp1.close
Return False
End If