在主项目经常用到的窗口加一按钮、两个标签,窗口AfterLoad事件代码: Dim lbl As WinForm.Label Dim lb2 As WinForm.Label Dim s As String = CRCCheckFile("\\192.168.3.100\aaa\Publish\Project\1111.FoxEx") Dim s1 As String = CRCCheckFile("E:\bbb\Publish\Project\1111.FoxEx") lbl = e.Form.Controls("最新版本") lb2 = e.Form.Controls("现在版本") lbl.Text = "" & s & "" lb2.Text = "" & s1 & "" If s=s1 Then e.Form.Controls ("更新系统"). Visible = False Else e.Form.Controls ("更新系统"). Visible = True End If 按钮代码: For Each dt As DataTable In DataTables dt.Save()'保存所有数据 Next Syscmd.Project.Exit() Dim Proc As New Process '定义一个新的Process Proc.File = "E:\更新程序\Publish\更新程序" '指定要打开的文件 Proc.Start()'打开文件 更新程序项目属性AfterOpenProject事件代码: FileSys.CopyDirectory ("\\192.168.3.100\aaa\Publish", "E:\bbb\Publish", True) Dim Proc As New Process '定义一个新的Process Proc.File = "E:\bbb\Publish\123456" '指定要打开的文件 Proc.Start()'打开文件 Syscmd.Project.Exit()
|