資源簡介
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.IO;
using?ESBasic;
using?AutoUpdater.Properties;
using?ESBasic.Helpers;
namespace?AutoUpdater
{
????///?
????///?說明:
????///?OAUS使用的是免費版的通信框架ESframework,最多支持10個人同時在線更新。如果要突破10人限制,請聯系?www.oraycn.com
????///?
????public?partial?class?MainForm?:?Form
????{
????????private?Updater?updater;????
????????private?int?fileCount?=?0;?//要升級的文件個數。
????????private?Timer?timer?=?new?Timer();
????????private?string?callBackExeName;???//自動升級完成后,要啟動的exe的名稱。
????????private?string?callBackPath?=?““;?//自動升級完成后,要啟動的exe的完整路徑。????????
????????private?bool?startAppAfterClose?=?false;?//關閉升級窗體前,是否啟動應用程序。
????????public?MainForm(string?serverIP?int?serverPort?string?_callBackExeName?string?title)
????????{
????????????InitializeComponent();
????????????this.updater?=?new?Updater(serverIP?serverPort);
????????????this.updater.ToBeUpdatedFilesCount?+=?new?CbGeneric(updater_ToBeUpdatedFilesCount);
????????????this.updater.UpdateStarted?+=?new?CbGeneric(updater_UpdateStarted);
????????????this.updater.FileToBeUpdated?+=?new?CbGeneric(updater_FileToBeUpdated);
????????????this.updater.CurrentFileUpdatingProgress?+=?new?CbGeneric(updater_CurrentFileUpdatingProgress);
????????????this.updater.UpdateDisruptted?+=?new?CbGeneric(updater_UpdateDisruptted);
????????????this.updater.UpdateCompleted?+=?new?CbGeneric(updater_UpdateCompleted);
????????????this.updater.ConnectionInterrupted?+=?new?CbGeneric(updater_ConnectionInterrupted);
????????????this.updater.UpdateContinued?+=?new?CbGeneric(updater_UpdateContinued);
????????????this.timer.Interval?=?1000;
????????????this.timer.Tick?+=?new?EventHandler(timer_Tick);
???????????
????????????DirectoryInfo?dir?=?new?DirectoryInfo(AppDomain.CurrentDomain.baseDirectory);???????????
????????????this.callBackExeName?=?_callBackExeName;
????????????this.callBackPath?=?dir.Parent.FullName?+?“\\“?+?this.callBackExeName;?//自動升級完成后,要啟動的exe的完整路徑。(1)被分發的程序的可執行文件exe必須位于部署目錄的根目錄。(2)OAUS的客戶端(即整個AutoUpdater文件夾)也必須位于這個根目錄。
????????????this.Text?=?title;
????????????this.label1.Text?=?Resources.InitialInformation;
????????????this.progressBar1.Visible?=?false;
????????????this.updater.Start();
???????????????????????
????????}
????????void?updater_UpdateContinued()
????????{
????????????if?(this.InvokeRequired)
????????????{
????????????????this.BeginInvoke(new?CbGeneric(this.updater_UpdateContinued));
????????????}
????????????else
????????????{
????????????????//this.label_reconnect.Visible?=?false;
????????????????this.label_reconnect.Text?=?“重連成功,正在續傳...“;
????????????}
????????}
????????void?updater_ConnectionInterrupted()
????????{
????????????if?(this.InvokeRequired)
????????????{
????????????????this.BeginInvoke(new?CbGe
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.????237568??2019-12-23?15:50??OAUS源碼\.vs\OAUS\v16\.suo
?????文件??????????0??2019-12-23?11:49??OAUS源碼\.vs\OAUS\v16\Server\sqlite3\db.lock
?????文件????1802240??2019-12-23?15:50??OAUS源碼\.vs\OAUS\v16\Server\sqlite3\storage.ide
?????文件???????4286??2011-04-22?21:37??OAUS源碼\32.ico
?????文件???????4286??2011-11-02?10:46??OAUS源碼\AutoUpdater\32.ico
?????文件????????985??2019-12-23?11:51??OAUS源碼\AutoUpdater\App.config
?????文件???????4765??2019-12-23?11:51??OAUS源碼\AutoUpdater\AutoUpdater.csproj
?????文件????????369??2015-01-07?17:28??OAUS源碼\AutoUpdater\AutoUpdater.csproj.user
?????文件??????36864??2019-12-23?15:49??OAUS源碼\AutoUpdater\bin\Debug\AutoUpdater.exe
?????文件????????985??2019-12-23?11:51??OAUS源碼\AutoUpdater\bin\Debug\AutoUpdater.exe.config
?????文件??????40448??2019-12-23?15:49??OAUS源碼\AutoUpdater\bin\Debug\AutoUpdater.pdb
?????文件??????11608??2018-12-11?10:58??OAUS源碼\AutoUpdater\bin\Debug\AutoUpdater.vshost.exe
?????文件????????903??2015-12-02?09:42??OAUS源碼\AutoUpdater\bin\Debug\AutoUpdater.vshost.exe.config
?????文件???????2409??2011-11-03?14:35??OAUS源碼\AutoUpdater\bin\Debug\AutoUpdater.vshost.exe.manifest
?????文件?????443392??2019-12-23?15:45??OAUS源碼\AutoUpdater\bin\Debug\ESBasic.dll
?????文件?????237947??2019-12-20?11:21??OAUS源碼\AutoUpdater\bin\Debug\ESBasic.xm
?????文件????1173504??2019-12-20?14:43??OAUS源碼\AutoUpdater\bin\Debug\ESfr
?????文件?????354881??2018-12-08?09:02??OAUS源碼\AutoUpdater\bin\Debug\ESfr
?????文件???????7680??2019-12-23?15:49??OAUS源碼\AutoUpdater\bin\Debug\OAUS.Core.dll
?????文件??????26112??2019-12-23?15:49??OAUS源碼\AutoUpdater\bin\Debug\OAUS.Core.pdb
?????文件????????196??2019-12-23?15:50??OAUS源碼\AutoUpdater\bin\Debug\UpdateConfiguration.xm
?????文件???????9154??2015-12-02?09:52??OAUS源碼\AutoUpdater\MainForm.cs
?????文件???????5309??2015-12-02?09:43??OAUS源碼\AutoUpdater\MainForm.Designer.cs
?????文件??????12549??2015-12-02?09:43??OAUS源碼\AutoUpdater\MainForm.resx
?????文件??????????0??2019-12-23?15:49??OAUS源碼\AutoUpdater\obj\x86\Debug\AutoUpdater.csproj.CopyComplete
?????文件???????7674??2019-12-23?15:49??OAUS源碼\AutoUpdater\obj\x86\Debug\AutoUpdater.csproj.FileListAbsolute.txt
?????文件???????1015??2019-12-23?15:49??OAUS源碼\AutoUpdater\obj\x86\Debug\AutoUpdater.csproj.GenerateResource.cache
?????文件???????3458??2019-12-23?15:49??OAUS源碼\AutoUpdater\obj\x86\Debug\AutoUpdater.csprojAssemblyReference.cache
?????文件??????19500??2018-12-11?11:00??OAUS源碼\AutoUpdater\obj\x86\Debug\AutoUpdater.csprojResolveAssemblyReference.cache
?????文件??????36864??2019-12-23?15:49??OAUS源碼\AutoUpdater\obj\x86\Debug\AutoUpdater.exe
............此處省略147個文件信息
- 上一篇:基于sharpGL3D圖形開放庫仿真3D機器人
- 下一篇:C#向量類定義及應用
評論
共有 條評論