-
大小: 35KB文件類(lèi)型: .cs金幣: 1下載: 0 次發(fā)布日期: 2021-05-12
- 語(yǔ)言: C#
- 標(biāo)簽: 自動(dòng)更新??
資源簡(jiǎn)介
根據(jù)服務(wù)器版本,自動(dòng)更新PDA的程序,數(shù)據(jù),腳本,更新方式有CAB、zip
代碼片段和文件信息
using?System;
using?System.Data;
using?System.Text;
using?System.Windows.Forms;
using?Pda.Config;
using?System.IO;
using?System.Diagnostics;
using?System.xml;
using?System.Threading;
using?System.Data.SQLite;
namespace?Pda.Download
{
????public?partial??class?frmDownload?:?Form
????{
????????private?bool?isEnd?=?false;
????????Thread?thUpdate?=?null;
????????string?UpdatePath?=?Path.Combine(PubUnit.rootPath?PubUnit.patchPath);
????????string?xmlLocalPath?=?Path.Combine(PubUnit.rootPath?PubUnit.xmlVerName);
????????string?xmlLocPath?=?Path.Combine(PubUnit.rootPath?PubUnit.xmlLocalName);
????????//string?UpdatePath?=?Path.Combine(PubUnit.rootPath?PubUnit.patchPath);
????????private?int?FCount?=?3;
????????public?frmDownload()
????????{
????????????InitializeComponent();
????????????//全屏顯示
????????????IntPtr?hWnd?=?Win32.FindWindow(“HHTaskBar“?null);
????????????if?(hWnd?!=?IntPtr.Zero)
????????????{
????????????????Win32.ShowWindow(hWnd?0);
????????????}
????????????timer1.Enabled?=?true;
????????????timer2.Enabled?=?true;
????????}
????????#region?progress
????????public?delegate?void?dlgShowProcess(int?pValue);
????????public?delegate?void?dlgShowMsg(string?pMsg);
????????private?delegate?void?dlgDisableControl(System.Windows.Forms.Control?pControl?bool?pFlag);
????????public?void?ShowProcess(int?pValue)
????????{
????????????if?(this.pbMsg.InvokeRequired)
????????????{
????????????????dlgShowProcess?dlg?=?new?dlgShowProcess(ShowProcess);
????????????????this.Invoke(dlg?new?object[]?{?pValue?});
????????????}
????????????else
????????????{
????????????????this.pbMsg.Value?=?pValue;
????????????}
????????}
????????public?void?ShowMsg(string?pMsg)
????????{
????????????if?(this.label1.InvokeRequired)
????????????{
????????????????dlgShowMsg?dlg?=?new?dlgShowMsg(ShowMsg);
????????????????this.Invoke(dlg?new?object[]?{?pMsg?});
????????????}
????????????else
????????????{
????????????????this.label1.Text?=?pMsg;
????????????}
????????}
????????private?void?DisableControl(System.Windows.Forms.Control?pControl?bool?pFlag)
????????{
????????????if?(pControl.InvokeRequired)
????????????{
????????????????dlgDisableControl?dlg?=?new?dlgDisableControl(DisableControl);
????????????????this.Invoke(dlg?new?object[]?{?pControl?pFlag?});
????????????}
????????????else
????????????{
????????????????pControl.Enabled?=?pFlag;
????????????}
????????}
????????#endregion
????????private?void?UPdate()
????????{
????????}
????????private?void?ShowCount()
????????{
????????????this.label1.Text?=?(string.Format(“{0}秒后自動(dòng)開(kāi)始下載。“?this.FCount));
????????}
???????
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????this.FCount--;
????????????this.ShowCount();
????????????if?(this.FCount?<=?0)
????????????{
????????????????this.timer1.Enabled?=?(false);
????????????????this.label1.Text?=?(string.Format(“正在更新中。。。“?this.FCoun
- 上一篇:在線(xiàn)拍照asp.net
- 下一篇:test5.csv
評(píng)論
共有 條評(píng)論