自动升级代码用了很多年了,应该不会有问题吧?If TryConnectHost("www.baidu.com") = False Then '如果无法解析
UpdatePath = "http://188.18.8.8/zfbt"
End If
If Syscmd.Project.Update(False,False) = False Then '如果没有升级
Forms("主窗口").open
basemainform.visible=False '隐藏主界面
Forms("用户登录窗").open
Else
If filesys.FileExists(ProjectPath.Replace("project\","") & "住房补贴.exe") = True 'MIS.exe是发布后项目的名称
Dim Proc As New Process
Proc.File = ProjectPath.Replace("project\","") & "住房补贴.exe"
Proc.Start()
Else
Dim Proc As New Process
Proc.File = ProjectFile
Proc.Start()
End If
System.Diagnostics.Process.GetProcessesByName("foxtable")(0).Kill
End If