Переглянути джерело

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 роки тому
батько
коміт
144bffe8e5

+ 88 - 0
TestProject/Form2.cs

@@ -1,11 +1,34 @@
 using System;
 using System.Windows.Forms;
 using BenQGuru.eMES.DLLService;
+using System.Drawing.Drawing2D;
+using System.Drawing;
+using System.Runtime.InteropServices;
 
 namespace TestProject
 {
     public partial class Form2 : Form
     {
+
+        //所有用到了headBar的部分都需要这段代码
+        [DllImport("user32.dll")]
+        public static extern bool ReleaseCapture();
+
+        [DllImport("user32.dll")]
+        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
+
+        [DllImport("user32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)]
+        public static extern int GetWindowLong(HandleRef hWnd, int nIndex);
+
+        [DllImport("user32.dll", EntryPoint = "SetWindowLong", CharSet = CharSet.Auto)]
+        public static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
+
+        public const int WM_SYSCOMMAND = 0x0112;
+        public const int SC_MOVE = 0xF010;
+        public const int HTCAPTION = 0x0002;
+
+        private Panel TitlePanel;
+
         public Form2()
         {
             InitializeComponent();
@@ -41,13 +64,28 @@ namespace TestProject
 
         private void InitializeComponent()
         {
+            this.TitlePanel = new System.Windows.Forms.Panel();
             this.SuspendLayout();
             // 
+            // TitlePanel
+            // 
+            this.TitlePanel.Dock = System.Windows.Forms.DockStyle.Top;
+            this.TitlePanel.Location = new System.Drawing.Point(0, 0);
+            this.TitlePanel.Name = "TitlePanel";
+            this.TitlePanel.Size = new System.Drawing.Size(435, 40);
+            this.TitlePanel.TabIndex = 0;
+            this.TitlePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
+            this.TitlePanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TitlePanel_MouseDown);
+            // 
             // Form2
             // 
+            this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(435, 184);
+            this.Controls.Add(this.TitlePanel);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Name = "Form2";
             this.Load += new System.EventHandler(this.Form2_Load_1);
+            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form2_Paint);
             this.ResumeLayout(false);
 
         }
@@ -56,5 +94,55 @@ namespace TestProject
         {
 
         }
+
+        private void Form2_Paint(object sender, PaintEventArgs e)
+        {
+          
+        }
+
+        internal static GraphicsPath CreateRoundedRectanglePath(Rectangle rect, int cornerRadius)
+        {
+            GraphicsPath roundedRect = new GraphicsPath();
+            roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
+            roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
+            roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
+            roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Y + rect.Height - cornerRadius * 2);
+            roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
+            roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom);
+            roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
+            roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2);
+            roundedRect.CloseFigure();
+            return roundedRect;
+        }
+
+        private void panel1_Paint(object sender, PaintEventArgs e)
+        {
+            Graphics g = e.Graphics;
+            Pen p = new Pen(Color.CadetBlue, 2);
+            Rectangle rect = new Rectangle(TitlePanel.Location, TitlePanel.Size);
+            LinearGradientBrush b3 = new LinearGradientBrush(rect, Color.LightSkyBlue, Color.White, LinearGradientMode.Vertical);
+            g.FillRectangle(b3, rect);
+            g.DrawString("通知公告", new Font("微软雅黑", 14F, FontStyle.Regular, GraphicsUnit.Point, 134), Brushes.Black, TitlePanel.Width / 2 - 40, 2);
+            //绘制关闭按钮矩形
+            b3 = new LinearGradientBrush(rect, Color.IndianRed, Color.White, LinearGradientMode.Vertical);
+            rect = new Rectangle(new Point(TitlePanel.Location.X + TitlePanel.Size.Width - TitlePanel.Size.Height, 0), new Size(TitlePanel.Size.Height, TitlePanel.Size.Height));
+            //绘制关闭按钮实线
+            GraphicsPath Rect = CreateRoundedRectanglePath(rect, 1);
+            g.FillPath(Brushes.Tomato, Rect);
+            g.DrawLine(new Pen(Color.White, 4), new Point(TitlePanel.Location.X + TitlePanel.Size.Width - TitlePanel.Size.Height + 12, 12), new Point(TitlePanel.Location.X + TitlePanel.Size.Width - 12, TitlePanel.Size.Height - 12));
+            g.DrawLine(new Pen(Color.White, 4), new Point(TitlePanel.Location.X + TitlePanel.Size.Width - TitlePanel.Size.Height + 12, TitlePanel.Size.Height - 12), new Point(TitlePanel.Location.X + TitlePanel.Size.Width - 12, 12));
+            //绘制最小化按钮
+            rect = new Rectangle(new Point(TitlePanel.Location.X + TitlePanel.Size.Width - TitlePanel.Size.Height * 2 - 10, 0), new Size(TitlePanel.Size.Height, TitlePanel.Size.Height));
+            //使用路径绘制
+            Rect = CreateRoundedRectanglePath(rect, 1);
+            g.FillPath(Brushes.Tomato, Rect);
+            g.DrawLine(new Pen(Color.White, 4), new Point(TitlePanel.Location.X + TitlePanel.Size.Width - TitlePanel.Size.Height*2 , 20), new Point(TitlePanel.Location.X + TitlePanel.Size.Width - TitlePanel.Size.Height - 20, 20));
+        }
+
+        private void TitlePanel_MouseDown(object sender, MouseEventArgs e)
+        {
+            ReleaseCapture();
+            SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
+        }
     }
 }

+ 39 - 3
UAS-MES/Form1.Designer.cs

@@ -30,6 +30,9 @@
         {
             this.button1 = new System.Windows.Forms.Button();
             this.button2 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
+            this.progressBar1 = new System.Windows.Forms.ProgressBar();
             this.SuspendLayout();
             // 
             // button1
@@ -52,12 +55,42 @@
             this.button2.Text = "button2";
             this.button2.UseVisualStyleBackColor = true;
             // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(305, 158);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(75, 23);
+            this.button3.TabIndex = 0;
+            this.button3.Text = "button3";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click_1);
+            // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(410, 158);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(75, 23);
+            this.button4.TabIndex = 2;
+            this.button4.Text = "button4";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
+            // progressBar1
+            // 
+            this.progressBar1.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.progressBar1.Location = new System.Drawing.Point(216, 90);
+            this.progressBar1.Name = "progressBar1";
+            this.progressBar1.Size = new System.Drawing.Size(336, 23);
+            this.progressBar1.TabIndex = 3;
+            // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1239, 738);
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ClientSize = new System.Drawing.Size(929, 590);
+            this.Controls.Add(this.progressBar1);
+            this.Controls.Add(this.button4);
+            this.Controls.Add(this.button3);
             this.Name = "Form1";
             this.Tag = "123123";
             this.Text = "Form1";
@@ -73,5 +106,8 @@
         private CustomControl.ButtonUtil.NormalButton normalButton1;
         private CustomControl.TextBoxWithIcon.EnterTextBox enterTextBox1;
         private CustomControl.SetLoading.LoadingCircle loadingCircle1;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.ProgressBar progressBar1;
     }
 }

+ 101 - 1
UAS-MES/Form1.cs

@@ -9,10 +9,16 @@ using System.Text;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;
 using System.Windows.Forms.DataVisualization.Charting;
+using System.Web.ClientServices;
 using UAS_MES.CustomControl.DataGrid_View;
 using UAS_MES.DataOperate;
 using UAS_MES.PublicForm;
 using UAS_MES.PublicMethod;
+using System.Net;
+using System.IO;
+using System.Reflection;
+using System.Threading;
+using UAS_MES.CustomControl;
 
 namespace UAS_MES
 {
@@ -45,9 +51,103 @@ namespace UAS_MES
 
         private void Form1_Load(object sender, EventArgs e)
         {
-        
 
         }
 
+        private void button3_Click_1(object sender, EventArgs e)
+        {
+            // 禁用按钮
+            //this.button1.Enabled = false;
+
+            //// 实例化业务对象
+            //PublicMethod.LongTimeWork workder = new PublicMethod.LongTimeWork();
+
+            //workder.ValueChanged += new PublicMethod.ValueChangedEventHandler(workder_ValueChanged);
+
+            //// 使用异步方式调用长时间的方法
+            //Action handler = new Action(workder.LongTimeMethod);
+            //handler.BeginInvoke(new AsyncCallback(this.AsyncCallback), handler);
+            WebClient wc = new WebClient();
+            wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
+            wc.DownloadFileAsync(new Uri("http://218.17.158.219:8888/UAS_WinForm.zip"), "UAS_WinForm.zip");
+            //processBar1.Run();
+        }
+
+        // 结束异步操作
+        private void AsyncCallback(IAsyncResult ar)
+        {
+            // 标准的处理步骤
+            Action handler = ar.AsyncState as Action;
+            handler.EndInvoke(ar);
+            MessageBox.Show("工作完成!");
+            System.Windows.Forms.MethodInvoker invoker = () =>
+            {
+                // 重新启用按钮
+                this.button3.Enabled = true;
+            };
+            if (this.InvokeRequired)
+            {
+                this.Invoke(invoker);
+            }
+            else
+            {
+                invoker();
+            }
+        }
+
+        private void Wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
+        {
+            Action act = () =>
+            {
+                this.progressBar1.Value = e.ProgressPercentage;
+                //this.label1.Text = e.ProgressPercentage + "%";
+            };
+            if (e.ProgressPercentage == 100) {
+                ZipHelper.UnZip(@"H:\UAS_WinForm\UAS-MES\bin\Debug\icsharpcode-SharpZipLib-4ad264b.zip", @"D:\");
+            }
+            this.Invoke(act);
+        }
+
+        //public static void Unzip()
+        //{
+        //    string _appPath = new DirectoryInfo(Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName).Parent.FullName;
+        //    string s7z = _appPath + @"\7-Zip\7z.exe";
+        //    System.Diagnostics.Process pNew = new System.Diagnostics.Process();
+        //    pNew.StartInfo.FileName = s7z;
+        //    pNew.StartInfo.Arguments = string.Format(" x \"{0}\\{1}\" -y -o\"{0}\"", _appPath, zipFileFullName);
+        //    //x "1" -y -o"2" 这段7z命令的意思: x是解压的意思 "{0}"的位置写要解压文件路径"{1}"这个1的位置写要解压的文件名 -y是覆盖的意思 -o是要解压的位置
+        //    pNew.Start();
+        //    //等待完成
+        //    pNew.WaitForExit();
+        //    //删除压缩包
+        //    File.Delete(_appPath + @"\" + zipFileFullName);
+        //}
+
+        private void button4_Click(object sender, EventArgs e)
+        {
+            WebClient wc = new WebClient();
+            wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
+            wc.DownloadFileAsync(new Uri("http://218.17.158.219:8888/UAS_WinForm.zip"), "UAS_WinForm.zip");
+          
+        }
     }
+
+    //public class ZipHelper
+    //{
+    //    public static string zipFileFullName = "UAS_WinForm.zip";
+    //    public static void Unzip()
+    //    {
+    //        string _appPath = new DirectoryInfo(Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName).Parent.FullName;
+    //        string s7z = _appPath + @"\7z.exe";
+    //        System.Diagnostics.Process pNew = new System.Diagnostics.Process();
+    //        pNew.StartInfo.FileName = s7z;
+    //        pNew.StartInfo.Arguments = string.Format(" x \"{0}\\{1}\" -y -o\"{0}\"", _appPath, zipFileFullName);
+    //        //x "1" -y -o"2" 这段7z命令的意思: x是解压的意思 "{0}"的位置写要解压文件路径"{1}"这个1的位置写要解压的文件名 -y是覆盖的意思 -o是要解压的位置
+    //        pNew.Start();
+    //        //等待完成
+    //        pNew.WaitForExit();
+    //        //删除压缩包
+    //        //File.Delete(_appPath + @"\" + zipFileFullName);
+    //    }
+    //}
 }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_LabelCheck.cs

@@ -71,7 +71,7 @@ namespace UAS_MES.Make
                     OperateResult.AppendText("<<"+sncode.Text+"\n", Color.Black);
                     //查询是否存在该ms_id
                     sql.Clear();
-                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from  makesnrelation where beforesn='"+sncode.Text+"'  and ms_makecode=makecode)");
+                    sql.Append("select max(MS_id) ms_id from makeserial where ms_sncode='"+sncode.Text+"' or ms_firstsn in (select firstsn from makesnrelation where beforesn='"+sncode.Text+"')");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
                     {

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -709,7 +709,7 @@ namespace UAS_MES.Make
             //取MakeProcess表中的执行记录ID最大的一个工单的号码
             oMakeCode = "";
             oErrorMessage = "";
-            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "upper(ms_sncode)='" + iSnCode.ToUpper() + "' or ms_firstsn in (select firstsn from makesnrelation where upper(beforesn)='" + iSnCode.ToUpper() + "')").ToString();
+            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "ms_sncode='" + iSnCode + "' or ms_firstsn in (select firstsn from makesnrelation where beforesn='" + iSnCode + "')").ToString();
             oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
             if (oMakeCode != "")
                 return true;

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -82,7 +82,7 @@ namespace UAS_MES.Make
                         if (bsncode == "")
                         {
                             //定义传入方法的变量
-                            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "upper(ms_sncode)='" + sncode.Text.ToUpper() + "' or ms_firstsn in (select firstsn from makesnrelation where upper(beforesn)='" + sncode.Text.ToUpper() + "')").ToString();
+                            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "ms_sncode='" + sncode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where beforesn='" + sncode.Text + "')").ToString();
                             oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
                             if (oMakeCode == "")
                             {

+ 30 - 27
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.Designer.cs

@@ -54,18 +54,21 @@
             // 
             // collectCodeRules
             // 
+            this.collectCodeRules.AllowUserToAddRows = false;
+            this.collectCodeRules.AllowUserToDeleteRows = false;
             this.collectCodeRules.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.collectCodeRules.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.psr_type,
             this.psr_prefix,
             this.psr_length,
             this.Column1});
-            this.collectCodeRules.Location = new System.Drawing.Point(248, 58);
+            this.collectCodeRules.Enabled = false;
+            this.collectCodeRules.Location = new System.Drawing.Point(279, 70);
             this.collectCodeRules.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.collectCodeRules.Name = "collectCodeRules";
             this.collectCodeRules.RowHeadersVisible = false;
             this.collectCodeRules.RowTemplate.Height = 30;
-            this.collectCodeRules.Size = new System.Drawing.Size(652, 196);
+            this.collectCodeRules.Size = new System.Drawing.Size(734, 235);
             this.collectCodeRules.TabIndex = 6;
             // 
             // psr_type
@@ -100,9 +103,9 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(244, 22);
+            this.label1.Location = new System.Drawing.Point(274, 26);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(110, 31);
             this.label1.TabIndex = 7;
             this.label1.Text = "防呆规则";
             // 
@@ -139,11 +142,11 @@
             this.collects.Controls.Add(this.Imei1);
             this.collects.Controls.Add(this.Imei2);
             this.collects.Controls.Add(this.Imei3);
-            this.collects.Location = new System.Drawing.Point(24, 15);
+            this.collects.Location = new System.Drawing.Point(27, 18);
             this.collects.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.collects.Name = "collects";
             this.collects.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.collects.Size = new System.Drawing.Size(199, 239);
+            this.collects.Size = new System.Drawing.Size(224, 287);
             this.collects.TabIndex = 92;
             this.collects.TabStop = false;
             this.collects.TextColor = System.Drawing.Color.Black;
@@ -152,11 +155,11 @@
             // 
             this.Mac.AutoSize = true;
             this.Mac.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Mac.Location = new System.Drawing.Point(33, 20);
+            this.Mac.Location = new System.Drawing.Point(37, 23);
             this.Mac.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Mac.Name = "Mac";
             this.Mac.Power = null;
-            this.Mac.Size = new System.Drawing.Size(133, 31);
+            this.Mac.Size = new System.Drawing.Size(157, 35);
             this.Mac.TabIndex = 5;
             this.Mac.Text = "MAC/WIFI";
             this.Mac.UseVisualStyleBackColor = true;
@@ -166,11 +169,11 @@
             // 
             this.Bt.AutoSize = true;
             this.Bt.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Bt.Location = new System.Drawing.Point(33, 57);
+            this.Bt.Location = new System.Drawing.Point(37, 67);
             this.Bt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Bt.Name = "Bt";
             this.Bt.Power = null;
-            this.Bt.Size = new System.Drawing.Size(58, 31);
+            this.Bt.Size = new System.Drawing.Size(69, 35);
             this.Bt.TabIndex = 4;
             this.Bt.Text = "BT";
             this.Bt.UseVisualStyleBackColor = true;
@@ -180,11 +183,11 @@
             // 
             this.NetCode.AutoSize = true;
             this.NetCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.NetCode.Location = new System.Drawing.Point(33, 93);
+            this.NetCode.Location = new System.Drawing.Point(37, 110);
             this.NetCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.NetCode.Name = "NetCode";
             this.NetCode.Power = null;
-            this.NetCode.Size = new System.Drawing.Size(74, 31);
+            this.NetCode.Size = new System.Drawing.Size(88, 35);
             this.NetCode.TabIndex = 3;
             this.NetCode.Text = "网标";
             this.NetCode.UseVisualStyleBackColor = true;
@@ -194,11 +197,11 @@
             // 
             this.Imei1.AutoSize = true;
             this.Imei1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Imei1.Location = new System.Drawing.Point(33, 129);
+            this.Imei1.Location = new System.Drawing.Point(37, 154);
             this.Imei1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei1.Name = "Imei1";
             this.Imei1.Power = null;
-            this.Imei1.Size = new System.Drawing.Size(89, 31);
+            this.Imei1.Size = new System.Drawing.Size(104, 35);
             this.Imei1.TabIndex = 2;
             this.Imei1.Text = "IMEI1";
             this.Imei1.UseVisualStyleBackColor = true;
@@ -208,11 +211,11 @@
             // 
             this.Imei2.AutoSize = true;
             this.Imei2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Imei2.Location = new System.Drawing.Point(33, 166);
+            this.Imei2.Location = new System.Drawing.Point(37, 198);
             this.Imei2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei2.Name = "Imei2";
             this.Imei2.Power = null;
-            this.Imei2.Size = new System.Drawing.Size(89, 31);
+            this.Imei2.Size = new System.Drawing.Size(104, 35);
             this.Imei2.TabIndex = 1;
             this.Imei2.Text = "IMEI2";
             this.Imei2.UseVisualStyleBackColor = true;
@@ -222,11 +225,11 @@
             // 
             this.Imei3.AutoSize = true;
             this.Imei3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Imei3.Location = new System.Drawing.Point(33, 202);
+            this.Imei3.Location = new System.Drawing.Point(37, 241);
             this.Imei3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei3.Name = "Imei3";
             this.Imei3.Power = null;
-            this.Imei3.Size = new System.Drawing.Size(89, 31);
+            this.Imei3.Size = new System.Drawing.Size(104, 35);
             this.Imei3.TabIndex = 0;
             this.Imei3.Text = "IMEI3";
             this.Imei3.UseVisualStyleBackColor = true;
@@ -237,11 +240,11 @@
             this.inputValue.AllPower = null;
             this.inputValue.BackColor = System.Drawing.Color.White;
             this.inputValue.ID = null;
-            this.inputValue.Location = new System.Drawing.Point(147, 477);
+            this.inputValue.Location = new System.Drawing.Point(165, 572);
             this.inputValue.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.inputValue.Name = "inputValue";
             this.inputValue.Power = null;
-            this.inputValue.Size = new System.Drawing.Size(229, 25);
+            this.inputValue.Size = new System.Drawing.Size(257, 28);
             this.inputValue.Str = null;
             this.inputValue.Str1 = null;
             this.inputValue.Str2 = null;
@@ -251,10 +254,10 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(24, 272);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.OperateResult.Location = new System.Drawing.Point(27, 326);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(876, 191);
+            this.OperateResult.Size = new System.Drawing.Size(985, 228);
             this.OperateResult.TabIndex = 88;
             this.OperateResult.Text = "";
             // 
@@ -262,17 +265,17 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(69, 475);
+            this.label3.Location = new System.Drawing.Point(78, 570);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(72, 27);
+            this.label3.Size = new System.Drawing.Size(86, 31);
             this.label3.TabIndex = 93;
             this.label3.Text = "输入框";
             // 
             // Make_UpdateCollectCode
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(924, 512);
+            this.ClientSize = new System.Drawing.Size(1040, 614);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.collects);
             this.Controls.Add(this.inputValue);

+ 5 - 0
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -73,6 +73,11 @@ namespace UAS_MES.Make
                 OperateResult.AppendText(">>" + inputValue.Text + "\n", Color.Black);
                 if (step == 0)
                 {
+                    //避免第一步出错的时候添加不需要的数据
+                    if (list.Count!=0)
+                    {
+                        list.Clear();
+                    }
                     //判断是否有已勾选的项次
                     foreach (Control ctl in collects.Controls)
                     {

+ 61 - 0
UAS-MES/PublicMethod/ZipHelper.cs

@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ICSharpCode.SharpZipLib.Zip;
+using System.IO;
+
+namespace UAS_MES.PublicMethod
+{
+    class ZipHelper
+    {
+        /// <summary>
+        /// 用于解压缩Zip文件
+        /// </summary>
+        /// <param name="ZipFilePath"></param>
+        /// <param name="UnZipPath"></param>
+        public static void UnZip(string ZipFilePath, string UnZipPath)
+        {
+            if (!File.Exists(ZipFilePath))
+            {
+                throw new FileNotFoundException(string.Format("未能找到文件 '{0}' ", ZipFilePath));
+            }
+
+            if (!Directory.Exists(UnZipPath))
+            {
+                Directory.CreateDirectory(UnZipPath);
+            }
+
+            using (var s = new ZipInputStream(File.OpenRead(ZipFilePath)))
+            {
+                ZipEntry theEntry;
+                while ((theEntry = s.GetNextEntry()) != null)
+                {
+                    if (theEntry.IsDirectory)
+                    {
+                        continue;
+                    }
+                    string directorName = Path.Combine(UnZipPath, Path.GetDirectoryName(theEntry.Name));
+                    string fileName = Path.Combine(directorName, Path.GetFileName(theEntry.Name));
+                    if (!Directory.Exists(directorName))
+                    {
+                        Directory.CreateDirectory(directorName);
+                    }
+                    if (!String.IsNullOrEmpty(fileName))
+                    {
+                        using (FileStream streamWriter = File.Create(fileName))
+                        {
+                            int size = 4096;
+                            byte[] data = new byte[size];
+                            while (size > 0)
+                            {
+                                streamWriter.Write(data, 0, size);
+                                size = s.Read(data, 0, data.Length);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

BIN
UAS-MES/Tool/ICSharpCode.SharpZipLib.dll


+ 72 - 0
UAS_AutoUpdate/CheckUpdateWindow.Designer.cs

@@ -0,0 +1,72 @@
+namespace UAS_AutoUpdate
+{
+    partial class CheckUpdateWindow
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this._progressbar = new System.Windows.Forms.ProgressBar();
+            this._processrate = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // _progressbar
+            // 
+            this._progressbar.Location = new System.Drawing.Point(44, 56);
+            this._progressbar.Name = "_progressbar";
+            this._progressbar.Size = new System.Drawing.Size(253, 23);
+            this._progressbar.TabIndex = 0;
+            // 
+            // _processrate
+            // 
+            this._processrate.AutoSize = true;
+            this._processrate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this._processrate.Location = new System.Drawing.Point(307, 57);
+            this._processrate.Name = "_processrate";
+            this._processrate.Size = new System.Drawing.Size(0, 21);
+            this._processrate.TabIndex = 1;
+            // 
+            // CheckUpdateWindow
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(373, 142);
+            this.Controls.Add(this._processrate);
+            this.Controls.Add(this._progressbar);
+            this.Name = "CheckUpdateWindow";
+            this.Text = "检测升级";
+            this.Load += new System.EventHandler(this.CheckUpdateWindow_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ProgressBar _progressbar;
+        private System.Windows.Forms.Label _processrate;
+    }
+}
+

+ 93 - 0
UAS_AutoUpdate/CheckUpdateWindow.cs

@@ -0,0 +1,93 @@
+using ICSharpCode.SharpZipLib.Zip;
+using System;
+using System.IO;
+using System.Net;
+using System.Windows.Forms;
+
+namespace UAS_AutoUpdate
+{
+    public partial class CheckUpdateWindow : Form
+    {
+        public CheckUpdateWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void CheckUpdateWindow_Load(object sender, EventArgs e)
+        {
+            //使用WebClient从指定位置下载文件,然后进行解压缩覆盖
+            WebClient wc = new WebClient();
+            wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
+            wc.DownloadFileAsync(new Uri("http://218.17.158.219:8888/UAS_MES.zip"), "UAS_MES.zip");
+        
+        }
+
+        private void Wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
+        {
+            Action act = () =>
+            {
+                _progressbar.Value = e.ProgressPercentage;
+                _processrate.Text = e.ProgressPercentage + "%";
+            };
+            if (IsHandleCreated)
+                this.Invoke(act);
+            if (e.ProgressPercentage == 100)
+            {
+                ZipHelper.UnZip(Application.StartupPath + @"\UAS_MES.zip", Application.StartupPath);
+                File.Delete(Application.StartupPath + @"\UAS_MES.zip");
+            }
+        }
+    }
+
+    public class ZipHelper
+    {
+        /// <summary>
+        /// 用于解压缩Zip文件
+        /// </summary>
+        /// <param name="ZipFilePath"></param>
+        /// <param name="UnZipPath"></param>
+        public static void UnZip(string ZipFilePath, string UnZipPath)
+        {
+            if (!File.Exists(ZipFilePath))
+            {
+                throw new FileNotFoundException(string.Format("未能找到文件 '{0}' ", ZipFilePath));
+            }
+
+            if (!Directory.Exists(UnZipPath))
+            {
+                Directory.CreateDirectory(UnZipPath);
+            }
+
+            using (var s = new ZipInputStream(File.OpenRead(ZipFilePath)))
+            {
+                ZipEntry theEntry;
+                while ((theEntry = s.GetNextEntry()) != null)
+                {
+                    if (theEntry.IsDirectory)
+                    {
+                        continue;
+                    }
+                    string directorName = Path.Combine(UnZipPath, Path.GetDirectoryName(theEntry.Name));
+                    string fileName = Path.Combine(directorName, Path.GetFileName(theEntry.Name));
+                    if (!Directory.Exists(directorName))
+                    {
+                        Directory.CreateDirectory(directorName);
+                    }
+                    if (!string.IsNullOrEmpty(fileName))
+                    {
+                        using (FileStream streamWriter = File.Create(fileName))
+                        {
+                            int size = 4096;
+                            byte[] data = new byte[size];
+                            while (size > 0)
+                            {
+                                size = s.Read(data, 0, data.Length);
+                                streamWriter.Write(data, 0, size);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 120 - 0
UAS_AutoUpdate/CheckUpdateWindow.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 66 - 0
UAS_AutoUpdate/Program.cs

@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Principal;
+using System.Windows.Forms;
+
+namespace UAS_AutoUpdate
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            try
+            {
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
+                //设置应用程序处理异常方式:ThreadException处理
+                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+                //处理UI线程异常
+                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
+                //处理非UI线程异常
+                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+                #region 应用程序的主入口点
+                Application.EnableVisualStyles();
+                Application.SetCompatibleTextRenderingDefault(false);
+                string sysdisc = Environment.GetEnvironmentVariable("windir").Substring(0, 1);
+                //创建标签缓存的文件夹
+
+                if (principal.IsInRole(WindowsBuiltInRole.Administrator))
+                    Application.Run(new CheckUpdateWindow());
+                else
+                {
+                    //创建启动对象
+                    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
+                    // 设置运行文件
+                    startInfo.FileName = Application.ExecutablePath;
+                    //设置启动动作,确保以管理员身份运行
+                    startInfo.Verb = "runas";
+                    //如果不是管理员,则启动UAC
+                    System.Diagnostics.Process.Start(startInfo);
+                }
+                #endregion
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+        }
+
+        //处理线程的异常
+        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
+        {
+            MessageBox.Show(e.Exception.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+        }
+
+        //未处理的异常统一通过这里返回
+        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+        {
+            MessageBox.Show(e.ExceptionObject.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+        }
+    }
+}

+ 36 - 0
UAS_AutoUpdate/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("UAS_AutoUpdate")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("深圳市优软科技有限公司")]
+[assembly: AssemblyProduct("CheckUpdate")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("c360004d-8d2c-4633-b8b8-3dd1c2d4aab6")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 73 - 0
UAS_AutoUpdate/Properties/Resources.Designer.cs

@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UAS_AutoUpdate.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_AutoUpdate.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   使用此强类型资源类,为所有资源查找
+        ///   重写当前线程的 CurrentUICulture 属性。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Icon update {
+            get {
+                object obj = ResourceManager.GetObject("update", resourceCulture);
+                return ((System.Drawing.Icon)(obj));
+            }
+        }
+    }
+}

+ 124 - 0
UAS_AutoUpdate/Properties/Resources.resx

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="update" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\update.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>

+ 26 - 0
UAS_AutoUpdate/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UAS_AutoUpdate.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 5 - 0
UAS_AutoUpdate/Properties/Settings.settings

@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles />
+  <Settings />
+</SettingsFile>

BIN
UAS_AutoUpdate/Resources/update.ico


+ 125 - 0
UAS_AutoUpdate/UAS_AutoUpdate.csproj

@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UAS_AutoUpdate</RootNamespace>
+    <AssemblyName>CheckUpdate</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>Resources\update.ico</ApplicationIcon>
+  </PropertyGroup>
+  <PropertyGroup />
+  <PropertyGroup />
+  <ItemGroup>
+    <Reference Include="ICSharpCode.SharpZipLib">
+      <HintPath>tool\ICSharpCode.SharpZipLib.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="CheckUpdateWindow.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CheckUpdateWindow.Designer.cs">
+      <DependentUpon>CheckUpdateWindow.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="CheckUpdateWindow.resx">
+      <DependentUpon>CheckUpdateWindow.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
+    </Compile>
+    <None Include="app.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 4.5</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\update.ico" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 5 - 0
UAS_AutoUpdate/app.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+    </configSections>
+</configuration>

BIN
UAS_AutoUpdate/tool/ICSharpCode.SharpZipLib.dll


+ 1 - 1
UAS_MesInterface(4.0)/MesHelper.cs

@@ -39,7 +39,7 @@ namespace BenQGuru.eMES.DLLService
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
+        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
         //用户选择的数据库的连接字符串
         private OracleConnection connection;
         //用户选择的数据库的连接字符串