Browse Source

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

Hcsy 7 years ago
parent
commit
72e31e68ea
50 changed files with 1014 additions and 1898 deletions
  1. 103 176
      UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs
  2. 28 181
      UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs
  3. 0 1
      UAS-出货标签管理/CustomControl/Pagination.cs
  4. 6 1
      UAS-出货标签管理/DbFind.cs
  5. 24 37
      UAS-出货标签管理/Login.Designer.cs
  6. 8 12
      UAS-出货标签管理/Login.cs
  7. 0 1
      UAS-出货标签管理/Program.cs
  8. 268 12
      UAS-出货标签管理/PublicMethod/BaseUtil.cs
  9. 15 20
      UAS-出货标签管理/PublicMethod/DataHelper.cs
  10. 86 0
      UAS-出货标签管理/PublicMethod/HttpHandler.cs
  11. 11 0
      UAS-出货标签管理/UAS-出货标签管理.csproj
  12. 2 2
      UAS-出货标签管理/客户标签维护.cs
  13. 4 1
      UAS_Web/Browser.Designer.cs
  14. 7 10
      UAS_Web/Browser.cs
  15. 3 0
      UAS_Web/Browser.resx
  16. 74 0
      UAS_Web/PrinterList.Designer.cs
  17. 33 0
      UAS_Web/PrinterList.cs
  18. 3 0
      UAS_Web/PrinterList.resx
  19. 37 2
      UAS_Web/Program.cs
  20. 25 17
      UAS_Web/Properties/Settings.Designer.cs
  21. 8 6
      UAS_Web/Properties/Settings.settings
  22. 11 4
      UAS_Web/UAS_Web.csproj
  23. 15 0
      UAS_Web/app.config
  24. 0 355
      UAS_Web/tool/BoundObject.cs
  25. 0 70
      UAS_Web/tool/ExceptionTestBoundObject.cs
  26. 22 6
      UAS_Web/tool/FilterManager.cs
  27. BIN
      UAS_Web/tool/Fnthex32.dll
  28. 0 93
      UAS_Web/tool/FormatterConverter.cs
  29. 1 0
      UAS_Web/tool/MenuHandler.cs
  30. 124 0
      UAS_Web/tool/PrintHelper.cs
  31. 96 19
      UAS_Web/tool/RequestHandler.cs
  32. 0 48
      UAS_WebBrowser/Browser.Designer.cs
  33. 0 22
      UAS_WebBrowser/Browser.cs
  34. 0 21
      UAS_WebBrowser/Program.cs
  35. 0 36
      UAS_WebBrowser/Properties/AssemblyInfo.cs
  36. 0 71
      UAS_WebBrowser/Properties/Resources.Designer.cs
  37. 0 117
      UAS_WebBrowser/Properties/Resources.resx
  38. 0 30
      UAS_WebBrowser/Properties/Settings.Designer.cs
  39. 0 7
      UAS_WebBrowser/Properties/Settings.settings
  40. 0 94
      UAS_WebBrowser/UAS_WebBrowser.csproj
  41. BIN
      UAS_WebBrowser/tool/Xilium.CefGlue.WindowsForms.dll
  42. BIN
      UAS_WebBrowser/tool/Xilium.CefGlue.dll
  43. 0 50
      UAS_WebKit/Form1.Designer.cs
  44. 0 21
      UAS_WebKit/Program.cs
  45. 0 36
      UAS_WebKit/Properties/AssemblyInfo.cs
  46. 0 71
      UAS_WebKit/Properties/Resources.Designer.cs
  47. 0 117
      UAS_WebKit/Properties/Resources.resx
  48. 0 30
      UAS_WebKit/Properties/Settings.Designer.cs
  49. 0 7
      UAS_WebKit/Properties/Settings.settings
  50. 0 94
      UAS_WebKit/UAS_WebKit.csproj

+ 103 - 176
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs

@@ -46,11 +46,6 @@
             this.sn_code_label = new System.Windows.Forms.Label();
             this.ma_softversion = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
-            this.CollectRemark = new System.Windows.Forms.CheckBox();
-            this.label1 = new System.Windows.Forms.Label();
-            this.IFONLY = new System.Windows.Forms.CheckBox();
-            this.SameReamrk = new System.Windows.Forms.CheckBox();
-            this.Seq_Remark_PreFix = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -62,7 +57,8 @@
             this.TSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SNLength = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.TSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.Remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.CollectRemark = new System.Windows.Forms.CheckBox();
+            this.Remark = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -70,10 +66,9 @@
             // 
             this.ms_macode_label.AutoSize = true;
             this.ms_macode_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_macode_label.Location = new System.Drawing.Point(19, 17);
-            this.ms_macode_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_macode_label.Location = new System.Drawing.Point(25, 21);
             this.ms_macode_label.Name = "ms_macode_label";
-            this.ms_macode_label.Size = new System.Drawing.Size(74, 21);
+            this.ms_macode_label.Size = new System.Drawing.Size(92, 27);
             this.ms_macode_label.TabIndex = 0;
             this.ms_macode_label.Text = "工单编号";
             // 
@@ -81,10 +76,9 @@
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_prodcode_label.Location = new System.Drawing.Point(289, 17);
-            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(385, 21);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
-            this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
+            this.ma_prodcode_label.Size = new System.Drawing.Size(92, 27);
             this.ma_prodcode_label.TabIndex = 1;
             this.ma_prodcode_label.Text = "产品编号";
             // 
@@ -92,10 +86,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail_label.Location = new System.Drawing.Point(527, 17);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(703, 21);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
             this.pr_detail_label.TabIndex = 2;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -103,10 +96,9 @@
             // 
             this.remain_qty_label.AutoSize = true;
             this.remain_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty_label.Location = new System.Drawing.Point(19, 45);
-            this.remain_qty_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.remain_qty_label.Location = new System.Drawing.Point(25, 56);
             this.remain_qty_label.Name = "remain_qty_label";
-            this.remain_qty_label.Size = new System.Drawing.Size(58, 21);
+            this.remain_qty_label.Size = new System.Drawing.Size(72, 27);
             this.remain_qty_label.TabIndex = 3;
             this.remain_qty_label.Text = "剩余数";
             // 
@@ -114,10 +106,9 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.PrintNum_label.Location = new System.Drawing.Point(655, 398);
-            this.PrintNum_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.PrintNum_label.Location = new System.Drawing.Point(879, 520);
             this.PrintNum_label.Name = "PrintNum_label";
-            this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
+            this.PrintNum_label.Size = new System.Drawing.Size(52, 27);
             this.PrintNum_label.TabIndex = 4;
             this.PrintNum_label.Text = "计数";
             this.PrintNum_label.Visible = false;
@@ -126,10 +117,9 @@
             // 
             this.ms_macode.AutoSize = true;
             this.ms_macode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_macode.Location = new System.Drawing.Point(94, 17);
-            this.ms_macode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_macode.Location = new System.Drawing.Point(125, 21);
             this.ms_macode.Name = "ms_macode";
-            this.ms_macode.Size = new System.Drawing.Size(0, 21);
+            this.ms_macode.Size = new System.Drawing.Size(0, 27);
             this.ms_macode.TabIndex = 5;
             this.ms_macode.TextChanged += new System.EventHandler(this.ms_macode_TextChanged);
             // 
@@ -137,20 +127,18 @@
             // 
             this.remain_qty.AutoSize = true;
             this.remain_qty.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty.Location = new System.Drawing.Point(94, 45);
-            this.remain_qty.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.remain_qty.Location = new System.Drawing.Point(125, 56);
             this.remain_qty.Name = "remain_qty";
-            this.remain_qty.Size = new System.Drawing.Size(0, 21);
+            this.remain_qty.Size = new System.Drawing.Size(0, 27);
             this.remain_qty.TabIndex = 6;
             // 
             // count
             // 
             this.count.AutoSize = true;
             this.count.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.count.Location = new System.Drawing.Point(712, 398);
-            this.count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.count.Location = new System.Drawing.Point(949, 518);
             this.count.Name = "count";
-            this.count.Size = new System.Drawing.Size(19, 21);
+            this.count.Size = new System.Drawing.Size(24, 27);
             this.count.TabIndex = 8;
             this.count.Text = "0";
             this.count.Visible = false;
@@ -159,10 +147,10 @@
             // 
             this.TSNLength_checkBox.AutoSize = true;
             this.TSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.TSNLength_checkBox.Location = new System.Drawing.Point(25, 81);
-            this.TSNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.TSNLength_checkBox.Location = new System.Drawing.Point(33, 101);
+            this.TSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.TSNLength_checkBox.Name = "TSNLength_checkBox";
-            this.TSNLength_checkBox.Size = new System.Drawing.Size(83, 24);
+            this.TSNLength_checkBox.Size = new System.Drawing.Size(100, 27);
             this.TSNLength_checkBox.TabIndex = 10;
             this.TSNLength_checkBox.Text = "TSN长度";
             this.TSNLength_checkBox.UseVisualStyleBackColor = true;
@@ -171,10 +159,10 @@
             // 
             this.SNLength_checkBox.AutoSize = true;
             this.SNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SNLength_checkBox.Location = new System.Drawing.Point(25, 111);
-            this.SNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.SNLength_checkBox.Location = new System.Drawing.Point(33, 139);
+            this.SNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.SNLength_checkBox.Name = "SNLength_checkBox";
-            this.SNLength_checkBox.Size = new System.Drawing.Size(75, 24);
+            this.SNLength_checkBox.Size = new System.Drawing.Size(90, 27);
             this.SNLength_checkBox.TabIndex = 11;
             this.SNLength_checkBox.Text = "SN长度";
             this.SNLength_checkBox.UseVisualStyleBackColor = true;
@@ -183,10 +171,10 @@
             // 
             this.TSNPre_checkBox.AutoSize = true;
             this.TSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.TSNPre_checkBox.Location = new System.Drawing.Point(428, 80);
-            this.TSNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.TSNPre_checkBox.Location = new System.Drawing.Point(571, 100);
+            this.TSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.TSNPre_checkBox.Name = "TSNPre_checkBox";
-            this.TSNPre_checkBox.Size = new System.Drawing.Size(83, 24);
+            this.TSNPre_checkBox.Size = new System.Drawing.Size(100, 27);
             this.TSNPre_checkBox.TabIndex = 12;
             this.TSNPre_checkBox.Text = "TSN前缀";
             this.TSNPre_checkBox.UseVisualStyleBackColor = true;
@@ -195,10 +183,10 @@
             // 
             this.SNPre_checkBox.AutoSize = true;
             this.SNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SNPre_checkBox.Location = new System.Drawing.Point(428, 112);
-            this.SNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.SNPre_checkBox.Location = new System.Drawing.Point(571, 140);
+            this.SNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.SNPre_checkBox.Name = "SNPre_checkBox";
-            this.SNPre_checkBox.Size = new System.Drawing.Size(75, 24);
+            this.SNPre_checkBox.Size = new System.Drawing.Size(90, 27);
             this.SNPre_checkBox.TabIndex = 13;
             this.SNPre_checkBox.Text = "SN前缀";
             this.SNPre_checkBox.UseVisualStyleBackColor = true;
@@ -207,10 +195,9 @@
             // 
             this.tip.AutoSize = true;
             this.tip.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold);
-            this.tip.Location = new System.Drawing.Point(19, 138);
-            this.tip.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.tip.Location = new System.Drawing.Point(25, 172);
             this.tip.Name = "tip";
-            this.tip.Size = new System.Drawing.Size(106, 22);
+            this.tip.Size = new System.Drawing.Size(132, 27);
             this.tip.TabIndex = 18;
             this.tip.Text = "采集提示信息";
             // 
@@ -218,10 +205,9 @@
             // 
             this.in_label.AutoSize = true;
             this.in_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.in_label.Location = new System.Drawing.Point(19, 417);
-            this.in_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.in_label.Location = new System.Drawing.Point(25, 521);
             this.in_label.Name = "in_label";
-            this.in_label.Size = new System.Drawing.Size(58, 21);
+            this.in_label.Size = new System.Drawing.Size(72, 27);
             this.in_label.TabIndex = 21;
             this.in_label.Text = "录入框";
             // 
@@ -229,9 +215,10 @@
             // 
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.ClearSn_code.Location = new System.Drawing.Point(267, 381);
+            this.ClearSn_code.Location = new System.Drawing.Point(356, 476);
+            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ClearSn_code.Name = "ClearSn_code";
-            this.ClearSn_code.Size = new System.Drawing.Size(16, 16);
+            this.ClearSn_code.Size = new System.Drawing.Size(21, 20);
             this.ClearSn_code.TabIndex = 144;
             this.ClearSn_code.TabStop = false;
             this.ClearSn_code.Click += new System.EventHandler(this.cancel_Click);
@@ -240,9 +227,10 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(19, 381);
+            this.sn_code_label.Location = new System.Drawing.Point(25, 476);
+            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
+            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
             this.sn_code_label.TabIndex = 142;
             this.sn_code_label.Text = "序列号";
             // 
@@ -250,90 +238,29 @@
             // 
             this.ma_softversion.AutoSize = true;
             this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_softversion.Location = new System.Drawing.Point(605, 45);
-            this.ma_softversion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ma_softversion.Location = new System.Drawing.Point(807, 56);
             this.ma_softversion.Name = "ma_softversion";
-            this.ma_softversion.Size = new System.Drawing.Size(0, 21);
+            this.ma_softversion.Size = new System.Drawing.Size(0, 27);
             this.ma_softversion.TabIndex = 150;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(527, 45);
+            this.label2.Location = new System.Drawing.Point(703, 56);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(74, 21);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 149;
             this.label2.Text = "软件版本";
             // 
-            // CollectRemark
-            // 
-            this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectRemark.Location = new System.Drawing.Point(551, 429);
-            this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(72, 16);
-            this.CollectRemark.TabIndex = 199;
-            this.CollectRemark.Text = "采集备注";
-            this.CollectRemark.UseVisualStyleBackColor = true;
-            this.CollectRemark.CheckedChanged += new System.EventHandler(this.CollectRemark_CheckedChanged);
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(356, 399);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(37, 20);
-            this.label1.TabIndex = 213;
-            this.label1.Text = "前缀";
-            // 
-            // IFONLY
-            // 
-            this.IFONLY.AutoSize = true;
-            this.IFONLY.Location = new System.Drawing.Point(360, 429);
-            this.IFONLY.Name = "IFONLY";
-            this.IFONLY.Size = new System.Drawing.Size(84, 16);
-            this.IFONLY.TabIndex = 211;
-            this.IFONLY.Text = "不允许重复";
-            this.IFONLY.UseVisualStyleBackColor = true;
-            this.IFONLY.CheckedChanged += new System.EventHandler(this.IFONLY_CheckedChanged);
-            // 
-            // SameReamrk
-            // 
-            this.SameReamrk.AutoSize = true;
-            this.SameReamrk.Location = new System.Drawing.Point(449, 429);
-            this.SameReamrk.Name = "SameReamrk";
-            this.SameReamrk.Size = new System.Drawing.Size(96, 16);
-            this.SameReamrk.TabIndex = 214;
-            this.SameReamrk.Text = "固定录入备注";
-            this.SameReamrk.UseVisualStyleBackColor = true;
-            this.SameReamrk.CheckedChanged += new System.EventHandler(this.SameReamrk_CheckedChanged);
-            // 
-            // Seq_Remark_PreFix
-            // 
-            this.Seq_Remark_PreFix.AllPower = null;
-            this.Seq_Remark_PreFix.BackColor = System.Drawing.Color.White;
-            this.Seq_Remark_PreFix.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.Seq_Remark_PreFix.ID = null;
-            this.Seq_Remark_PreFix.Location = new System.Drawing.Point(402, 396);
-            this.Seq_Remark_PreFix.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
-            this.Seq_Remark_PreFix.Name = "Seq_Remark_PreFix";
-            this.Seq_Remark_PreFix.Power = null;
-            this.Seq_Remark_PreFix.Size = new System.Drawing.Size(38, 23);
-            this.Seq_Remark_PreFix.Str = null;
-            this.Seq_Remark_PreFix.Str1 = null;
-            this.Seq_Remark_PreFix.Str2 = null;
-            this.Seq_Remark_PreFix.TabIndex = 212;
-            this.Seq_Remark_PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Seq_Remark_PreFix_KeyDown);
-            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(290, 45);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Location = new System.Drawing.Point(387, 56);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(88, 22);
+            this.StepCount.Size = new System.Drawing.Size(117, 28);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 195;
@@ -342,11 +269,11 @@
             // 
             this.ChangeResult.AutoSize = true;
             this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChangeResult.Location = new System.Drawing.Point(267, 413);
-            this.ChangeResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.ChangeResult.Location = new System.Drawing.Point(356, 516);
+            this.ChangeResult.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.ChangeResult.Name = "ChangeResult";
             this.ChangeResult.Power = "ifspecial";
-            this.ChangeResult.Size = new System.Drawing.Size(93, 25);
+            this.ChangeResult.Size = new System.Drawing.Size(114, 31);
             this.ChangeResult.TabIndex = 145;
             this.ChangeResult.Text = "重新转换";
             this.ChangeResult.UseVisualStyleBackColor = true;
@@ -359,10 +286,11 @@
             this.show_sncode.Enabled = false;
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.ID = null;
-            this.show_sncode.Location = new System.Drawing.Point(83, 381);
+            this.show_sncode.Location = new System.Drawing.Point(111, 476);
+            this.show_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Power = null;
-            this.show_sncode.Size = new System.Drawing.Size(160, 25);
+            this.show_sncode.Size = new System.Drawing.Size(212, 29);
             this.show_sncode.Str = null;
             this.show_sncode.Str1 = null;
             this.show_sncode.Str2 = null;
@@ -373,11 +301,11 @@
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(367, 17);
+            this.ma_prodcode.Location = new System.Drawing.Point(489, 21);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.ma_prodcode.MaximumSize = new System.Drawing.Size(133, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(177, 0);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
             this.ma_prodcode.TabIndex = 24;
             // 
             // pr_detail
@@ -385,11 +313,11 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(604, 17);
+            this.pr_detail.Location = new System.Drawing.Point(805, 21);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(109, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(145, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 21);
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 23;
             // 
             // code
@@ -398,11 +326,11 @@
             this.code.BackColor = System.Drawing.Color.White;
             this.code.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(83, 415);
-            this.code.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.code.Location = new System.Drawing.Point(111, 519);
+            this.code.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.code.Name = "code";
             this.code.Power = null;
-            this.code.Size = new System.Drawing.Size(160, 25);
+            this.code.Size = new System.Drawing.Size(212, 29);
             this.code.Str = null;
             this.code.Str1 = null;
             this.code.Str2 = null;
@@ -412,10 +340,10 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
-            this.OperateResult.Location = new System.Drawing.Point(23, 166);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.OperateResult.Location = new System.Drawing.Point(31, 208);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(770, 199);
+            this.OperateResult.Size = new System.Drawing.Size(1025, 248);
             this.OperateResult.TabIndex = 19;
             this.OperateResult.Text = "";
             // 
@@ -425,11 +353,11 @@
             this.SNPre.BackColor = System.Drawing.Color.White;
             this.SNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.SNPre.ID = null;
-            this.SNPre.Location = new System.Drawing.Point(517, 111);
-            this.SNPre.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.SNPre.Location = new System.Drawing.Point(689, 139);
+            this.SNPre.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.SNPre.Name = "SNPre";
             this.SNPre.Power = null;
-            this.SNPre.Size = new System.Drawing.Size(143, 25);
+            this.SNPre.Size = new System.Drawing.Size(189, 29);
             this.SNPre.Str = null;
             this.SNPre.Str1 = null;
             this.SNPre.Str2 = null;
@@ -441,11 +369,11 @@
             this.TSNPre.BackColor = System.Drawing.Color.White;
             this.TSNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.TSNPre.ID = null;
-            this.TSNPre.Location = new System.Drawing.Point(517, 79);
-            this.TSNPre.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.TSNPre.Location = new System.Drawing.Point(689, 99);
+            this.TSNPre.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.TSNPre.Name = "TSNPre";
             this.TSNPre.Power = null;
-            this.TSNPre.Size = new System.Drawing.Size(143, 25);
+            this.TSNPre.Size = new System.Drawing.Size(189, 29);
             this.TSNPre.Str = null;
             this.TSNPre.Str1 = null;
             this.TSNPre.Str2 = null;
@@ -457,12 +385,12 @@
             this.SNLength.BackColor = System.Drawing.Color.White;
             this.SNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.SNLength.ID = null;
-            this.SNLength.Location = new System.Drawing.Point(123, 110);
-            this.SNLength.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.SNLength.Location = new System.Drawing.Point(164, 138);
+            this.SNLength.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.SNLength.Name = "SNLength";
             this.SNLength.Negative = false;
             this.SNLength.Power = null;
-            this.SNLength.Size = new System.Drawing.Size(143, 25);
+            this.SNLength.Size = new System.Drawing.Size(189, 29);
             this.SNLength.Str = null;
             this.SNLength.Str1 = null;
             this.SNLength.Str2 = null;
@@ -474,45 +402,48 @@
             this.TSNLength.BackColor = System.Drawing.Color.White;
             this.TSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.TSNLength.ID = null;
-            this.TSNLength.Location = new System.Drawing.Point(123, 79);
-            this.TSNLength.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.TSNLength.Location = new System.Drawing.Point(164, 99);
+            this.TSNLength.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.TSNLength.Name = "TSNLength";
             this.TSNLength.Negative = false;
             this.TSNLength.Power = null;
-            this.TSNLength.Size = new System.Drawing.Size(143, 25);
+            this.TSNLength.Size = new System.Drawing.Size(189, 29);
             this.TSNLength.Str = null;
             this.TSNLength.Str1 = null;
             this.TSNLength.Str2 = null;
             this.TSNLength.TabIndex = 14;
             // 
+            // CollectRemark
+            // 
+            this.CollectRemark.AutoSize = true;
+            this.CollectRemark.Checked = true;
+            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.CollectRemark.Location = new System.Drawing.Point(483, 471);
+            this.CollectRemark.Margin = new System.Windows.Forms.Padding(4);
+            this.CollectRemark.Name = "CollectRemark";
+            this.CollectRemark.Size = new System.Drawing.Size(100, 27);
+            this.CollectRemark.TabIndex = 199;
+            this.CollectRemark.Text = "采集备注";
+            this.CollectRemark.UseVisualStyleBackColor = true;
+            // 
             // Remark
             // 
-            this.Remark.AllPower = null;
-            this.Remark.BackColor = System.Drawing.Color.White;
-            this.Remark.ID = null;
-            this.Remark.Location = new System.Drawing.Point(453, 373);
-            this.Remark.Margin = new System.Windows.Forms.Padding(2);
-            this.Remark.Multiline = true;
+            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Remark.Location = new System.Drawing.Point(594, 469);
+            this.Remark.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.Remark.Name = "Remark";
-            this.Remark.Power = null;
-            this.Remark.Size = new System.Drawing.Size(148, 46);
-            this.Remark.Str = null;
-            this.Remark.Str1 = null;
-            this.Remark.Str2 = null;
-            this.Remark.TabIndex = 215;
-            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
+            this.Remark.Size = new System.Drawing.Size(253, 89);
+            this.Remark.TabIndex = 198;
+            this.Remark.Text = "";
             // 
             // Make_SeqProgramTransform
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(813, 454);
-            this.Controls.Add(this.Remark);
-            this.Controls.Add(this.SameReamrk);
-            this.Controls.Add(this.label1);
-            this.Controls.Add(this.Seq_Remark_PreFix);
-            this.Controls.Add(this.IFONLY);
+            this.ClientSize = new System.Drawing.Size(1084, 568);
             this.Controls.Add(this.CollectRemark);
+            this.Controls.Add(this.Remark);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.label2);
@@ -543,7 +474,7 @@
             this.Controls.Add(this.ma_prodcode_label);
             this.Controls.Add(this.ms_macode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.Name = "Make_SeqProgramTransform";
             this.Tag = "Make!SeqProgramTransform";
             this.Load += new System.EventHandler(this.Make_SeqProgramTransform_Load);
@@ -586,10 +517,6 @@
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
         private System.Windows.Forms.CheckBox CollectRemark;
-        private System.Windows.Forms.Label label1;
-        private CustomControl.TextBoxWithIcon.SnCollectionBox Seq_Remark_PreFix;
-        private System.Windows.Forms.CheckBox IFONLY;
-        private System.Windows.Forms.CheckBox SameReamrk;
-        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
+        private CustomControl.RichText.RichTextAutoBottom Remark;
     }
 }

+ 28 - 181
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -78,7 +78,6 @@ namespace UAS_MES.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
-            Seq_Remark_PreFix.Text = BaseUtil.GetCacheData("Seq_Remark_PreFix").ToString();
         }
 
         private void code_KeyDown(object sender, KeyEventArgs e)
@@ -372,46 +371,6 @@ namespace UAS_MES.Make
         /// <param name="step"></param>
         private bool checkRules(int step)
         {
-            //说明已经是最后一个校验规则
-            if (step == ListA.Rows.Count + 1)
-            {
-                if (CollectRemark.Checked || SameReamrk.Checked)
-                {
-                    if (Remark.Text == "")
-                    {
-                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
-                        Remark.SelectAll();
-                        Remark.Focus();
-                        return false;
-                    }
-                    if (IFONLY.Checked)
-                    {
-                        if (!CheckPre())
-                        {
-                            return false;
-                        }
-                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
-                        if (UsedSncode != "")
-                        {
-                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
-                            Remark.SelectAll();
-                            Remark.Focus();
-                            return false;
-                        }
-                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
-                    }
-                    else if (SameReamrk.Checked)
-                    {
-                        if (!CheckPre())
-                        {
-                            return false;
-                        }
-                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
-                    }
-                }
-                return SetStepResult();
-            }
-
             type = ListA.Rows[step - 2]["psr_type"].ToString();
             //将type中的mac和bt中的"-"和":"号去掉
             if (type == "MAC" || type == "BT")
@@ -598,105 +557,47 @@ namespace UAS_MES.Make
             //说明已经是最后一个校验规则
             if (step == ListA.Rows.Count + 1)
             {
-                if (CollectRemark.Checked || SameReamrk.Checked)
+                //通过存储过程二次校验
+                if (LogicHandler.snChangeAndBurn(TSN, SN, User.UserSourceCode, User.UserCode, ms_macode.Text, ChangeResult.Checked ? 1 : 0, (hs.ContainsKey("IMEI1") ? hs["IMEI1"].ToString() : ""), (hs.ContainsKey("IMEI2") ? hs["IMEI2"].ToString() : ""), (hs.ContainsKey("IMEI3") ? hs["IMEI3"].ToString() : ""), "", (hs.ContainsKey("NETCODE") ? hs["NETCODE"].ToString() : ""), "", "", "", "", (hs.ContainsKey("MAC") ? hs["MAC"].ToString() : ""), (hs.ContainsKey("BT") ? hs["BT"].ToString() : ""), "", "", "", out errorMessage))
                 {
-                    if (Remark.Text == "")
+                    OperateResult.AppendText("<<序列号" + TSN + "成功转换为" + SN + "\n<<关联采集成功\n", Color.Green);
+                    //写入日志
+                    LogManager.DoLog("修改序列号:" + TSN + "为" + SN + "成功!" + "操作人:" + User.UserCode);
+                    //记录日志
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_macode.Text, User.UserLineCode, User.UserSourceCode, "序列烧录转换", TSN + "转换为" + SN, SN, "");
+                    //获取剩余数,刷新页面
+                    sql.Clear();
+                    sql.Append("select mcd_inqty from makecraftdetail where mcd_macode='" + ms_macode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count > 0)
                     {
-                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
-                        Remark.SelectAll();
-                        Remark.Focus();
-                        return false;
-                    }
-                    if (IFONLY.Checked)
-                    {
-                        if (!CheckPre())
-                        {
-                            return false;
-                        }
-                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
-                        if (UsedSncode != "")
-                        {
-                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
-                            Remark.SelectAll();
-                            Remark.Focus();
-                            return false;
-                        }
-                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                        remain_qty.Text = ma_qty - int.Parse(dt.Rows[0]["mcd_inqty"].ToString()) + "";
                     }
-                    else if (SameReamrk.Checked)
+                    if (CollectRemark.Checked && Remark.Text != "")
                     {
-                        if (!CheckPre())
-                        {
-                            return false;
-                        }
-                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                        LogicHandler.CollectRemarkInf(SN, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
                     }
+                    //更新页面计数+1
+                    count.Text = int.Parse(count.Text) + 1 + "";
+                    //完成之后,清除信息
+                    clearInfo();
+                    OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
                 }
-                return SetStepResult();
-            }
-            else
-            {
-                OperateResult.AppendText(">>请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green, code);
-                return true;
-            }
-        }
-
-        //校验备注前缀
-        private Boolean CheckPre()
-        {
-            try
-            {
-                if (Remark.Text.Substring(0, Seq_Remark_PreFix.Text.Length) != Seq_Remark_PreFix.Text)
+                else
                 {
-                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
-                    Remark.SelectAll();
-                    Remark.Focus();
-                    return false;
+                    OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red, code);
+                    OperateResult.AppendText(">>请重新输入TSN\n", Color.Black, code);
+                    //    //清空信息
+                    clearInfo();
                 }
-            }
-            catch (Exception)
-            {
-                OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
-                Remark.SelectAll();
-                Remark.Focus();
+                code.Text = "";
                 return false;
             }
-            return true;
-        }
-
-        //通过存储过程二次校验
-        private Boolean SetStepResult()
-        {
-            if (LogicHandler.snChangeAndBurn(TSN, SN, User.UserSourceCode, User.UserCode, ms_macode.Text, ChangeResult.Checked ? 1 : 0, (hs.ContainsKey("IMEI1") ? hs["IMEI1"].ToString() : ""), (hs.ContainsKey("IMEI2") ? hs["IMEI2"].ToString() : ""), (hs.ContainsKey("IMEI3") ? hs["IMEI3"].ToString() : ""), "", (hs.ContainsKey("NETCODE") ? hs["NETCODE"].ToString() : ""), "", "", "", "", (hs.ContainsKey("MAC") ? hs["MAC"].ToString() : ""), (hs.ContainsKey("BT") ? hs["BT"].ToString() : ""), "", "", "", out errorMessage))
-            {
-                OperateResult.AppendText("<<序列号" + TSN + "成功转换为" + SN + "\n<<关联采集成功\n", Color.Green);
-                //写入日志
-                LogManager.DoLog("修改序列号:" + TSN + "为" + SN + "成功!" + "操作人:" + User.UserCode);
-                //记录日志
-                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_macode.Text, User.UserLineCode, User.UserSourceCode, "序列烧录转换", TSN + "转换为" + SN, SN, "");
-                //获取剩余数,刷新页面
-                sql.Clear();
-                sql.Append("select mcd_inqty from makecraftdetail where mcd_macode='" + ms_macode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dt.Rows.Count > 0)
-                {
-                    remain_qty.Text = ma_qty - int.Parse(dt.Rows[0]["mcd_inqty"].ToString()) + "";
-                }
-                //更新页面计数+1
-                count.Text = int.Parse(count.Text) + 1 + "";
-                //完成之后,清除信息
-                clearInfo();
-                OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
-            }
             else
             {
-                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red, code);
-                OperateResult.AppendText(">>请重新输入TSN\n", Color.Black, code);
-                //    //清空信息
-                clearInfo();
+                OperateResult.AppendText(">>请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green, code);
+                return true;
             }
-            code.Text = "";
-            return false;
         }
         /// <summary>
         /// 工单号变化时,带出校验规则
@@ -816,59 +717,5 @@ namespace UAS_MES.Make
         {
             asc.controlAutoSize(this);
         }
-
-        private void Seq_Remark_PreFix_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                BaseUtil.SetCacheData("Seq_Remark_PreFix", Seq_Remark_PreFix.Text);
-                if (CollectRemark.Checked || SameReamrk.Checked)
-                {
-                    Remark.SelectAll();
-                    Remark.Focus();
-                }
-            }
-        }
-
-        private void Remark_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                if (step == ListA.Rows.Count + 1 && (CollectRemark.Checked || SameReamrk.Checked) && Remark.Text != "")
-                {
-                    code.Text = Remark.Text;
-                    code.Focus();
-                    code_KeyDown(this, new KeyEventArgs(Keys.Enter));
-                }
-                 else
-                 code.Focus();
-            }
-        }
-
-        private void IFONLY_CheckedChanged(object sender, EventArgs e)
-        {
-            if (IFONLY.Checked)
-            {
-                SameReamrk.Checked = false;
-                CollectRemark.Checked = true;
-            }
-        }
-
-        private void SameReamrk_CheckedChanged(object sender, EventArgs e)
-        {
-            if (SameReamrk.Checked)
-            {
-                IFONLY.Checked = false;
-                CollectRemark.Checked = false;
-            }
-        }
-
-        private void CollectRemark_CheckedChanged(object sender, EventArgs e)
-        {
-            if (CollectRemark.Checked)
-            {
-                SameReamrk.Checked = false;
-            }
-        }
     }
 }

+ 0 - 1
UAS-出货标签管理/CustomControl/Pagination.cs

@@ -61,7 +61,6 @@ namespace UAS_LabelMachine.CustomControl
             //当前在多少页
             Current_Page = int.Parse(this.CurrentPage.Text);
             //获取记录的总行数
-            Console.WriteLine(TableName);
             RowCount = dh.getRowCount(TableName);
             //分页获取数据,先取第一页的
             dt = dh.getFieldsDatasByPageing(TableName, field, Current_Page, PageSize, Caller, condition);

+ 6 - 1
UAS-出货标签管理/DbFind.cs

@@ -77,6 +77,10 @@ namespace UAS_LabelMachine
             {
                 //先绑定空的结构
                 DbFindGridView.DataSource = dt;
+                for (int i = 0; i < DbFindGridView.Columns.Count; i++)
+                {
+                    DbFindGridView.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
+                }
                 //获取查询的字段的拼接语句
                 pagination1.BindDataToNavigator(DbFindGridView, tablename, SelectField, "ID", caller, Condition == null ? "" : Condition);
                 IsAbleDbFind = true;
@@ -175,7 +179,8 @@ namespace UAS_LabelMachine
         //列宽发生变化的时候TextBox的宽度也发生变化
         private void DbFindGridView_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
         {
-            ctl[DbFindGridView.Columns.IndexOf(e.Column)].Width = e.Column.Width;
+            if (ctl != null)
+                ctl[DbFindGridView.Columns.IndexOf(e.Column)].Width = e.Column.Width;
         }
     }
 }

+ 24 - 37
UAS-出货标签管理/Login.Designer.cs

@@ -50,10 +50,9 @@
             // 
             this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
             this.pictureBox1.Image = global::UAS_LabelMachine.Properties.Resources.users_user_72px_523311_easyicon_net;
-            this.pictureBox1.Location = new System.Drawing.Point(312, 226);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
+            this.pictureBox1.Location = new System.Drawing.Point(234, 181);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(96, 90);
+            this.pictureBox1.Size = new System.Drawing.Size(72, 72);
             this.pictureBox1.TabIndex = 0;
             this.pictureBox1.TabStop = false;
             // 
@@ -63,30 +62,27 @@
             this.label1.BackColor = System.Drawing.Color.Transparent;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.SystemColors.Desktop;
-            this.label1.Location = new System.Drawing.Point(456, 156);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(342, 125);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(297, 35);
+            this.label1.Size = new System.Drawing.Size(231, 28);
             this.label1.TabIndex = 1;
             this.label1.Text = "优软-出货标签管理系统";
             // 
             // UserName
             // 
             this.UserName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.UserName.Location = new System.Drawing.Point(492, 210);
-            this.UserName.Margin = new System.Windows.Forms.Padding(4);
+            this.UserName.Location = new System.Drawing.Point(369, 168);
             this.UserName.Name = "UserName";
-            this.UserName.Size = new System.Drawing.Size(260, 34);
+            this.UserName.Size = new System.Drawing.Size(196, 29);
             this.UserName.TabIndex = 2;
             // 
             // PassWord
             // 
             this.PassWord.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PassWord.Location = new System.Drawing.Point(492, 258);
-            this.PassWord.Margin = new System.Windows.Forms.Padding(4);
+            this.PassWord.Location = new System.Drawing.Point(369, 206);
             this.PassWord.Name = "PassWord";
             this.PassWord.PasswordChar = '*';
-            this.PassWord.Size = new System.Drawing.Size(260, 34);
+            this.PassWord.Size = new System.Drawing.Size(196, 29);
             this.PassWord.TabIndex = 3;
             this.PassWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PassWord_KeyDown);
             // 
@@ -95,10 +91,9 @@
             this.LoginIcon.BackColor = System.Drawing.Color.Transparent;
             this.LoginIcon.Cursor = System.Windows.Forms.Cursors.Hand;
             this.LoginIcon.Image = global::UAS_LabelMachine.Properties.Resources.Login_Icon;
-            this.LoginIcon.Location = new System.Drawing.Point(564, 404);
-            this.LoginIcon.Margin = new System.Windows.Forms.Padding(4);
+            this.LoginIcon.Location = new System.Drawing.Point(423, 323);
             this.LoginIcon.Name = "LoginIcon";
-            this.LoginIcon.Size = new System.Drawing.Size(96, 32);
+            this.LoginIcon.Size = new System.Drawing.Size(72, 26);
             this.LoginIcon.TabIndex = 4;
             this.LoginIcon.TabStop = false;
             this.LoginIcon.Click += new System.EventHandler(this.LoginIcon_Click);
@@ -108,10 +103,9 @@
             this.label2.AutoSize = true;
             this.label2.BackColor = System.Drawing.Color.Transparent;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(428, 214);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(321, 171);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(52, 27);
+            this.label2.Size = new System.Drawing.Size(42, 21);
             this.label2.TabIndex = 5;
             this.label2.Text = "账号";
             // 
@@ -120,10 +114,9 @@
             this.label3.AutoSize = true;
             this.label3.BackColor = System.Drawing.Color.Transparent;
             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(432, 261);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(324, 209);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(52, 27);
+            this.label3.Size = new System.Drawing.Size(42, 21);
             this.label3.TabIndex = 6;
             this.label3.Text = "密码";
             // 
@@ -132,10 +125,9 @@
             this.MasterCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.MasterCombox.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.MasterCombox.FormattingEnabled = true;
-            this.MasterCombox.Location = new System.Drawing.Point(492, 309);
-            this.MasterCombox.Margin = new System.Windows.Forms.Padding(4);
+            this.MasterCombox.Location = new System.Drawing.Point(369, 247);
             this.MasterCombox.Name = "MasterCombox";
-            this.MasterCombox.Size = new System.Drawing.Size(260, 35);
+            this.MasterCombox.Size = new System.Drawing.Size(196, 29);
             this.MasterCombox.TabIndex = 7;
             // 
             // Master
@@ -143,10 +135,9 @@
             this.Master.AutoSize = true;
             this.Master.BackColor = System.Drawing.Color.Transparent;
             this.Master.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Master.Location = new System.Drawing.Point(432, 312);
-            this.Master.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Master.Location = new System.Drawing.Point(324, 250);
             this.Master.Name = "Master";
-            this.Master.Size = new System.Drawing.Size(52, 27);
+            this.Master.Size = new System.Drawing.Size(42, 21);
             this.Master.TabIndex = 8;
             this.Master.Text = "账套";
             // 
@@ -155,29 +146,26 @@
             this.label4.AutoSize = true;
             this.label4.BackColor = System.Drawing.Color.Transparent;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(432, 360);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(324, 288);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(30, 27);
+            this.label4.Size = new System.Drawing.Size(25, 21);
             this.label4.TabIndex = 10;
             this.label4.Text = "IP";
             // 
             // IP
             // 
             this.IP.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.IP.Location = new System.Drawing.Point(492, 356);
-            this.IP.Margin = new System.Windows.Forms.Padding(4);
+            this.IP.Location = new System.Drawing.Point(369, 285);
             this.IP.Name = "IP";
-            this.IP.Size = new System.Drawing.Size(260, 34);
+            this.IP.Size = new System.Drawing.Size(196, 29);
             this.IP.TabIndex = 9;
-            this.IP.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IP_KeyDown);
             // 
             // Login
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackgroundImage = global::UAS_LabelMachine.Properties.Resources.timg;
-            this.ClientSize = new System.Drawing.Size(1179, 576);
+            this.ClientSize = new System.Drawing.Size(884, 461);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.IP);
             this.Controls.Add(this.Master);
@@ -190,7 +178,6 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.pictureBox1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Login";
             this.Text = "出货标签管理系统";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Login_FormClosing);

+ 8 - 12
UAS-出货标签管理/Login.cs

@@ -3,8 +3,10 @@ using System.Data;
 using System.Drawing;
 using System.Drawing.Drawing2D;
 using System.IO;
+using System.Text;
 using System.Windows.Forms;
 using UAS_LabelMachine.Entity;
+using UAS_LabelMachine.PublicMethod;
 
 namespace UAS_LabelMachine
 {
@@ -29,7 +31,7 @@ namespace UAS_LabelMachine
         {
             dh = new DataHelper();
             //获取账套信息
-            dt = (DataTable)dh.ExecuteSql("select ma_function,ms_pwd,ma_user from datacenter.master where ma_enable<>0", "select");
+            dt = (DataTable)dh.ExecuteSql("select ma_function,ms_pwd,ma_user from master ", "select");
             MasterCombox.DisplayMember = "ma_function";
             MasterCombox.ValueMember = "ma_user";
             MasterCombox.DataSource = dt;
@@ -58,11 +60,12 @@ namespace UAS_LabelMachine
                     Ms_Pwd = dt.Rows[i]["ms_pwd"].ToString();
             }
             //切换至用户选择的数据源
-            string ConnectionString = "Data Source=" + IP.Text + "/orcl;User ID=" + MasterCombox.SelectedValue + ";PassWord=" + Ms_Pwd;
+            string ConnectionString = "Connection Timeout=0;Pooling=false;Password=" + Ms_Pwd + ";User ID=" + MasterCombox.SelectedValue.ToString() + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + IP.Text + ")(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             DataHelper.DBConnectionString = ConnectionString;
             //设置了Connection,重新执行构造函数,重置数据库连接
             dh = new DataHelper();
-            if (dh.CheckExist("employee", "em_code='" + UserName.Text + "' and em_password='" + PassWord.Text + "'"))
+            string oMsg = "";
+            if (HttpHandler.CheckUserLogin(UserName.Text, PassWord.Text, MasterCombox.SelectedValue.ToString(), out oMsg))
             {
                 dt = (DataTable)dh.ExecuteSql("select em_name,em_type from employee where em_code='" + UserName.Text + "'", "select");
                 User.UserName = dt.Rows[0]["em_name"].ToString();
@@ -80,8 +83,7 @@ namespace UAS_LabelMachine
                 main.ShowDialog();
                 Close();
             }
-            else
-                MessageBox.Show("用户名或者密码错误!");
+            else MessageBox.Show(oMsg);
         }
 
         /// <summary>
@@ -113,11 +115,5 @@ namespace UAS_LabelMachine
         {
             Application.Exit();
         }
-
-        private void IP_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-                DataHelper.DBConnectionString = "Data Source=" + IP.Text + "/orcl;User ID=DATACENTER;PassWord=select!#%*(";
-        }
     }
-}
+}

+ 0 - 1
UAS-出货标签管理/Program.cs

@@ -66,7 +66,6 @@ namespace UAS_LabelMachine
         //未处理的异常统一通过这里返回
         static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
         {
-            Console.WriteLine("异常");
             string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
             MessageBox.Show(str, "操作异常", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }

+ 268 - 12
UAS-出货标签管理/PublicMethod/BaseUtil.cs

@@ -3,11 +3,13 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Data;
 using System.Text;
-using System.Text.RegularExpressions;
 using System.Windows.Forms;
 using UAS_LabelMachine.CustomControl;
 using UAS_LabelMachine.CustomControl.GroupBoxWithBorder;
+using System.Security.Cryptography;
 using static System.Windows.Forms.Control;
+using System.IO;
+using System.Text.RegularExpressions;
 
 namespace UAS_LabelMachine
 {
@@ -16,6 +18,8 @@ namespace UAS_LabelMachine
 
         static string SysDisc;
 
+        private string Key = "96878265";
+
         public static string SysDisc1
         {
             get
@@ -29,6 +33,213 @@ namespace UAS_LabelMachine
             }
         }
 
+        public static byte[] hexStr2ByteArr(string strIn)
+        {
+            byte[] arrB = Encoding.UTF8.GetBytes(strIn);
+            int iLen = arrB.Length;
+            // 两个字符表示一个字节,所以字节数组长度是字符串长度除以2   
+            byte[] arrOut = new byte[iLen / 2];
+            for (int i = 0; i < iLen; i = i + 2)
+            {
+                string strTmp = new string(Encoding.UTF8.GetChars(arrB), i, 2);
+                arrOut[i / 2] = (byte)int.Parse(strTmp, System.Globalization.NumberStyles.HexNumber);
+            }
+            return arrOut;
+        }
+
+        public byte[] decrypt(byte[] arrB)
+        {
+            return null;
+            //return decryptCipher.doFinal(arrB);
+        }
+
+        public string decrypt(string strIn)
+        {
+            return new string(Encoding.ASCII.GetChars(decrypt(hexStr2ByteArr(strIn))));
+        }
+
+        public static string DESEnCode(string pToEncrypt, string sKey)
+        {
+            // string pToEncrypt1 = HttpContext.Current.Server.UrlEncode(pToEncrypt);   
+            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
+            byte[] inputByteArray = Encoding.GetEncoding("UTF-8").GetBytes(pToEncrypt);
+
+            //建立加密对象的密钥和偏移量    
+            //原文使用ASCIIEncoding.ASCII方法的GetBytes方法    
+            //使得输入密码必须输入英文文本    
+            des.Key = Encoding.UTF8.GetBytes(sKey);
+            des.IV = Encoding.UTF8.GetBytes(sKey);
+            MemoryStream ms = new MemoryStream();
+            CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
+
+            cs.Write(inputByteArray, 0, inputByteArray.Length);
+            cs.FlushFinalBlock();
+
+            StringBuilder ret = new StringBuilder();
+            foreach (byte b in ms.ToArray())
+            {
+                ret.AppendFormat("{0:X2}", b);
+            }
+            ret.ToString();
+            return ret.ToString();
+        }
+
+        public static string DESDeCode(string pToDecrypt, string sKey)
+        {
+            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
+
+            byte[] inputByteArray = new byte[pToDecrypt.Length / 2];
+            for (int x = 0; x < pToDecrypt.Length / 2; x++)
+            {
+                int i = (Convert.ToInt32(pToDecrypt.Substring(x * 2, 2), 16));
+                inputByteArray[x] = (byte)i;
+            }
+            des.Key = Encoding.UTF8.GetBytes(sKey);
+            des.IV = Encoding.UTF8.GetBytes(sKey);
+            MemoryStream ms = new MemoryStream();
+            CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
+            cs.Write(inputByteArray, 0, inputByteArray.Length);
+            cs.FlushFinalBlock();
+
+            return Encoding.UTF8.GetString(ms.ToArray());
+        }
+
+        public static byte[] Des3EncodeCBC(byte[] key, byte[] iv, byte[] data)
+        {
+            //复制于MSDN  
+            try
+            {
+                // Create a MemoryStream.  
+                MemoryStream mStream = new MemoryStream();
+                TripleDESCryptoServiceProvider tdsp = new TripleDESCryptoServiceProvider();
+                tdsp.Mode = CipherMode.CBC;             //默认值  
+                tdsp.Padding = PaddingMode.PKCS7;       //默认值  
+                                                        // Create a CryptoStream using the MemoryStream   
+                                                        // and the passed key and initialization vector (IV).  
+                CryptoStream cStream = new CryptoStream(mStream,
+                    tdsp.CreateEncryptor(key, iv),
+                    CryptoStreamMode.Write);
+                // Write the byte array to the crypto stream and flush it.  
+                cStream.Write(data, 0, data.Length);
+                cStream.FlushFinalBlock();
+                // Get an array of bytes from the   
+                // MemoryStream that holds the   
+                // encrypted data.  
+                byte[] ret = mStream.ToArray();
+                // Close the streams.  
+                cStream.Close();
+                mStream.Close();
+                // Return the encrypted buffer.  
+                return ret;
+            }
+            catch (CryptographicException e)
+            {
+                Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
+                return null;
+            }
+        }
+        /// <summary>  
+        /// DES3 CBC模式解密  
+        /// </summary>  
+        /// <param name="key">密钥</param>  
+        /// <param name="iv">IV</param>  
+        /// <param name="data">密文的byte数组</param>  
+        /// <returns>明文的byte数组</returns>  
+        public static byte[] Des3DecodeCBC(byte[] key, byte[] iv, byte[] data)
+        {
+            try
+            {
+                // Create a new MemoryStream using the passed   
+                // array of encrypted data.  
+                MemoryStream msDecrypt = new MemoryStream(data);
+                TripleDESCryptoServiceProvider tdsp = new TripleDESCryptoServiceProvider();
+                tdsp.Mode = CipherMode.CBC;
+                tdsp.Padding = PaddingMode.PKCS7;
+                // Create a CryptoStream using the MemoryStream   
+                // and the passed key and initialization vector (IV).  
+                CryptoStream csDecrypt = new CryptoStream(msDecrypt, tdsp.CreateDecryptor(key, iv), CryptoStreamMode.Read);
+                // Create buffer to hold the decrypted data.  
+                byte[] fromEncrypt = new byte[data.Length];
+                // Read the decrypted data out of the crypto stream  
+                // and place it into the temporary buffer.  
+                csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);
+                //Convert the buffer into a string and return it.  
+                return fromEncrypt;
+            }
+            catch (CryptographicException e)
+            {
+                Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
+                return null;
+            }
+        }
+
+        /// <summary>  
+        /// DES3 ECB模式加密  
+        /// </summary>  
+        /// <param name="key">密钥</param>  
+        /// <param name="iv">IV(当模式为ECB时,IV无用)</param>  
+        /// <param name="str">明文的byte数组</param>  
+        /// <returns>密文的byte数组</returns>  
+        public static byte[] Des3EncodeECB(byte[] key, byte[] iv, byte[] data)
+        {
+            try
+            {
+                // Create a MemoryStream.  
+                MemoryStream mStream = new MemoryStream();
+                TripleDESCryptoServiceProvider tdsp = new TripleDESCryptoServiceProvider();
+                tdsp.Mode = CipherMode.ECB;
+                tdsp.Padding = PaddingMode.PKCS7;
+                // Create a CryptoStream using the MemoryStream   
+                // and the passed key and initialization vector (IV).  
+                CryptoStream cStream = new CryptoStream(mStream, tdsp.CreateEncryptor(key, iv), CryptoStreamMode.Write);
+                // Write the byte array to the crypto stream and flush it.  
+                cStream.Write(data, 0, data.Length);
+                cStream.FlushFinalBlock();
+                // Get an array of bytes from the   
+                // MemoryStream that holds the   
+                // encrypted data.  
+                byte[] ret = mStream.ToArray();
+                // Close the streams.  
+                cStream.Close();
+                mStream.Close();
+                // Return the encrypted buffer.  
+                return ret;
+            }
+            catch (CryptographicException e)
+            {
+                Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
+                return null;
+            }
+        }
+        /// <summary>  
+        /// DES3 ECB模式解密  
+        /// </summary>  
+        /// <param name="key">密钥</param>  
+        /// <param name="iv">IV(当模式为ECB时,IV无用)</param>  
+        /// <param name="str">密文的byte数组</param>  
+        /// <returns>明文的byte数组</returns>  
+        public static byte[] Des3DecodeECB(byte[] key, byte[] iv, byte[] data)
+        {
+
+            // Create a new MemoryStream using the passed   
+            // array of encrypted data.  
+            MemoryStream msDecrypt = new MemoryStream(data);
+            TripleDESCryptoServiceProvider tdsp = new TripleDESCryptoServiceProvider();
+            tdsp.Mode = CipherMode.ECB;
+            tdsp.Padding = PaddingMode.PKCS7;
+            // Create a CryptoStream using the MemoryStream   
+            // and the passed key and initialization vector (IV).  
+            CryptoStream csDecrypt = new CryptoStream(msDecrypt, tdsp.CreateDecryptor(key, iv), CryptoStreamMode.Read);
+            // Create buffer to hold the decrypted data.  
+            byte[] fromEncrypt = new byte[data.Length];
+            // Read the decrypted data out of the crypto stream  
+            // and place it into the temporary buffer.  
+            csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);
+            //Convert the buffer into a string and return it.  
+            return fromEncrypt;
+
+        }
+
 
         /// <summary>
         /// 通过DataTable的ColumnName和Caption来拼接一条语句
@@ -41,7 +252,6 @@ namespace UAS_LabelMachine
             DataTable dt = (DataTable)d.DataSource;
             if (dt == null)
             {
-                Console.WriteLine("为空");
                 foreach (DataGridViewColumn dc in d.Columns)
                 {
                     if (dc.DataPropertyName != "" && dc.DataPropertyName != null)
@@ -52,15 +262,11 @@ namespace UAS_LabelMachine
             }
             else
             {
-                Console.WriteLine("不为空");
-                Console.WriteLine(dt.Columns.Count);
                 foreach (DataColumn dc in dt.Columns)
                 {
-                    Console.WriteLine(dc.Caption);
                     selectConetnt.Append(dc.Caption + " as " + dc.ColumnName + ",");
                 }
             }
-            Console.WriteLine(selectConetnt);
             return selectConetnt.Remove(selectConetnt.Length - 1, 1).ToString();
         }
         /// <summary>
@@ -187,15 +393,16 @@ namespace UAS_LabelMachine
         /// <param name="URL"></param>
         /// <param name="LabelName"></param>
         /// <returns></returns>
-        public static string GetLabelUrl(string URL, string LabelName,DateTime time)
+        public static string GetLabelUrl(string URL, string LabelName, DateTime time)
         {
             //如果是传入的数据是从FTP取的文件
             if (URL.Contains("ftp:"))
             {
                 ftpOperater ftp = new ftpOperater();
-                return ftp.Download(LabelName,time);
+                return ftp.Download(LabelName, time);
             }
-            else {
+            else
+            {
                 return URL;
             }
         }
@@ -228,7 +435,8 @@ namespace UAS_LabelMachine
                 }
             }
             //否则直接获取全部的数据
-            else {
+            else
+            {
                 for (int i = 0; i < dgv.RowCount; i++)
                 {
                     for (int j = 0; j < ColumnName.Length; j++)
@@ -522,7 +730,8 @@ namespace UAS_LabelMachine
                     {
                         condition += "(" + Condition[i].Tag + " like " + "'%" + (Condition[i] as ComboBox).SelectedValue + "%' or " + Condition[i].Tag + " is null)  and ";
                     }
-                    else {
+                    else
+                    {
                         condition += "(" + Condition[i].Tag + " like " + "'%" + Condition[i].Text + "%' or " + Condition[i].Tag + " is null) and ";
                     }
                 }
@@ -532,7 +741,8 @@ namespace UAS_LabelMachine
                     {
                         condition += "(" + Condition[i].Tag + " like " + "'%" + (Condition[i] as ComboBox).SelectedValue + "%' or " + Condition[i].Tag + " is null)";
                     }
-                    else {
+                    else
+                    {
                         condition += "(" + Condition[i].Tag + " like " + "'%" + Condition[i].Text + "%' or " + Condition[i].Tag + " is null)";
                     }
                 }
@@ -662,6 +872,52 @@ namespace UAS_LabelMachine
             }
         }
 
+        public static Dictionary<string, object> ToDictionary(string JsonData)
+        {
+            object Data = null;
+            Dictionary<string, object> Dic = new Dictionary<string, object>();
+            if (JsonData.StartsWith("["))
+            {
+                //如果目标直接就为数组类型,则将会直接输出一个Key为List的List<Dictionary<string, object>>集合 
+                //使用示例List<Dictionary<string, object>> ListDic = (List<Dictionary<string, object>>)Dic["List"]; 
+                List<Dictionary<string, object>> List = new List<Dictionary<string, object>>();
+                MatchCollection ListMatch = Regex.Matches(JsonData, @"{[\s\S]+?}");//使用正则表达式匹配出JSON数组 
+                foreach (Match ListItem in ListMatch)
+                {
+                    List.Add(ToDictionary(ListItem.ToString()));//递归调用 
+                }
+                Data = List;
+                Dic.Add("List", Data);
+            }
+            else
+            {
+                MatchCollection Match = Regex.Matches(JsonData, @"""(.+?)"": {0,1}(\[[\s\S]+?\]|null|"".+?""|-{0,1}\d*)");//使用正则表达式匹配出JSON数据中的键与值 
+                foreach (Match item in Match)
+                {
+                    try
+                    {
+                        if (item.Groups[2].ToString().StartsWith("["))
+                        {
+                            //如果目标是数组,将会输出一个Key为当前Json的List<Dictionary<string, object>>集合 
+                            //使用示例List<Dictionary<string, object>> ListDic = (List<Dictionary<string, object>>)Dic["Json中的Key"]; 
+                            List<Dictionary<string, object>> List = new List<Dictionary<string, object>>();
+                            MatchCollection ListMatch = Regex.Matches(item.Groups[2].ToString(), @"{[\s\S]+?}");//使用正则表达式匹配出JSON数组 
+                            foreach (Match ListItem in ListMatch)
+                            {
+                                List.Add(ToDictionary(ListItem.ToString()));//递归调用 
+                            }
+                            Data = List;
+                        }
+                        else if (item.Groups[2].ToString().ToLower() == "null") Data = null;//如果数据为null(字符串类型),直接转换成null
+                        else Data = item.Groups[2].ToString(); //数据为数字、字符串中的一类,直接写入 
+                        Dic.Add(item.Groups[1].ToString(), Data);
+                    }
+                    catch { }
+                }
+            }
+            return Dic;
+        }
+
         public static string AddField(string[] Fields)
         {
             string sql = " ";

+ 15 - 20
UAS-出货标签管理/PublicMethod/DataHelper.cs

@@ -14,6 +14,8 @@ namespace UAS_LabelMachine
         //ftp://richwellgroup.com.cn|printuser|printuser
         //怡海能达FTP
         //ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8
+        //华商龙FTP
+        //ftp://10.1.1.38|Print|Administrator1@#
         //系统默认的的连接字符串
         //private readonly string ConnectionStrings = "Data Source=218.17.158.219/orcl;User ID=UAS_DEV;PassWord=select!#%*(";
         //富为内网地址
@@ -21,9 +23,16 @@ namespace UAS_LabelMachine
         //富为外网地址
         //private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
         //怡海能达外网地址
-        private readonly string ConnectionStrings = "Data Source=sz.hi-mantech.com/orcl;User ID=YHND_SZ;PassWord=select!#%*(";
+        //private readonly string ConnectionStrings = "Data Source=sz.hi-mantech.com/orcl;User ID=YHND_SZ;PassWord=select!#%*(";
         //怡海能达内网地址
         //private readonly string ConnectionStrings = "Data Source=192.168.1.200/orcl;User ID=DATACENTER;PassWord=select!#%*(";
+        //怡海能达ERP地址
+        //public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
+        //华商龙外网地址
+        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YITOA_DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.18.115.198)(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //ERP的地址
+        public static readonly string ERPAddesss = "http://218.18.115.198:8888/ERP/";
+
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         static OracleConnection connection = null;
@@ -762,7 +771,6 @@ namespace UAS_LabelMachine
             }
         }
 
-      
         /// <summary>
         /// 直接执行SQL,同时传入SQL的类型
         /// </summary>
@@ -771,6 +779,7 @@ namespace UAS_LabelMachine
         /// <returns></returns>
         public object ExecuteSql(string SQL, string Type, params object[] names)
         {
+            Console.WriteLine(SQL);
             object result = null;
             command = new OracleCommand(SQL, connection);
             //用来拼接参数的
@@ -805,24 +814,10 @@ namespace UAS_LabelMachine
             {
                 case "SELECT":
                     result = new DataTable();
-                    try
-                    {
-                        OracleDataAdapter ad = new OracleDataAdapter(command);
-                        ad.Fill((DataTable)result);
-                        ad.Dispose();
-                        //成功执行后将重复连接数置为0
-                        ReconnectTime = 0;
-                    }
-                    catch (Exception)
-                    {
-                        if (ReconnectTime == 0)
-                        {
-                            //重置的数据库链接后只执行一次
-                            ReconnectTime=ReconnectTime+1;
-                            connection = new OracleConnection(DBConnectionString);
-                            result = ExecuteSql(SQL, Type, names);
-                        }
-                    }
+                    OracleDataAdapter ad = new OracleDataAdapter(command);
+                    ad.Fill((DataTable)result);
+                    ad.Dispose();
+                    //成功执行后将重复连接数置为0
                     break;
                 case "DELETE":
                     result = command.ExecuteNonQuery();

+ 86 - 0
UAS-出货标签管理/PublicMethod/HttpHandler.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Text;
+using System.Web;
+
+namespace UAS_LabelMachine.PublicMethod
+{
+    public class HttpHandler : IHttpHandler
+    {
+        /// <summary>
+        /// 您将需要在网站的 Web.config 文件中配置此处理程序 
+        /// 并向 IIS 注册它,然后才能使用它。有关详细信息,
+        /// 请参见下面的链接: http://go.microsoft.com/?linkid=8101007
+        /// </summary>
+        public bool IsReusable
+        {
+            // 如果无法为其他请求重用托管处理程序,则返回 false。
+            // 如果按请求保留某些状态信息,则通常这将为 false。
+            get { return true; }
+        }
+        public void ProcessRequest(HttpContext context)
+        {
+
+        }
+
+
+        public static bool CheckUserLogin(string UserName, string PassWord, string Master, out string oMsg)
+        {
+            oMsg = "";
+            try
+            {
+                string url = DataHelper.ERPAddesss + "mobile/login.action";//html调用的地址              
+                HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
+                if (webrequest == null)
+                {
+                    return false;
+                }
+                webrequest.Method = "POST";
+                webrequest.Timeout = 1000;
+                webrequest.ContentType = "application/x-www-form-urlencoded";
+                System.Collections.Hashtable pars = new System.Collections.Hashtable();
+                pars.Add("username", UserName);
+                pars.Add("password", PassWord);
+                pars.Add("master", Master);
+                string buffer = "";
+                //发送POST数据 
+                if (!(pars == null || pars.Count == 0))
+                {
+                    foreach (string key in pars.Keys)
+                    {
+                        buffer = buffer + "&" + key + "=" + pars[key].ToString();
+                    }
+                    byte[] data = Encoding.UTF8.GetBytes(buffer);
+                    using (Stream stream = webrequest.GetRequestStream())
+                    {
+                        stream.Write(data, 0, data.Length);
+                    }
+                }
+
+                string[] values = webrequest.Headers.GetValues("Content-Type");
+                WebResponse myResponse = webrequest.GetResponse();
+
+                using (Stream resStream = myResponse.GetResponseStream())//得到回写的流
+                {
+                    StreamReader newReader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
+                    string Content = newReader.ReadToEnd();
+                    Dictionary<string, object> dic = new Dictionary<string, object>();
+                    dic = BaseUtil.ToDictionary(Content);
+                    if (!dic.ContainsKey("erpaccount"))
+                    {
+                        oMsg = dic["reason"].ToString();
+                        return false;
+                    }
+                    newReader.Close();
+                }
+            }
+            catch (Exception ex)
+            {
+                LogManager.DoLog(ex.Message.ToString());
+            }
+            return true;
+        }
+    }
+}

+ 11 - 0
UAS-出货标签管理/UAS-出货标签管理.csproj

@@ -115,6 +115,7 @@
     <Reference Include="System.Core" />
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.ServiceModel" />
+    <Reference Include="System.Web" />
     <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
@@ -229,6 +230,7 @@
     <Compile Include="PublicMethod\ExcelHandler.cs" />
     <Compile Include="PublicMethod\ftpOperater.cs" />
     <Compile Include="PublicMethod\GlobalEventsHandler.cs" />
+    <Compile Include="PublicMethod\HttpHandler.cs" />
     <Compile Include="PublicMethod\LogManager.cs" />
     <Compile Include="Service References\Vivo_BoxReelRelation\Reference.cs">
       <AutoGen>True</AutoGen>
@@ -652,6 +654,15 @@
     <None Include="Resources\preview_16px_25980_easyicon.net.png" />
   </ItemGroup>
   <ItemGroup>
+    <COMReference Include="BarTender">
+      <Guid>{D58562C1-E51B-11CF-8941-00A024A9083F}</Guid>
+      <VersionMajor>7</VersionMajor>
+      <VersionMinor>75</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>tlbimp</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>False</EmbedInteropTypes>
+    </COMReference>
     <COMReference Include="stdole">
       <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
       <VersionMajor>2</VersionMajor>

+ 2 - 2
UAS-出货标签管理/客户标签维护.cs

@@ -72,12 +72,12 @@ namespace UAS_LabelMachine
 
             cu_code.FormName = Name;
             cu_code.SetValueField = new string[] { "cu_code", "cu_name" };
-            cu_code.TableName = "customer left join customerlabel on cu_code=cl_custcode";
+            cu_code.TableName = "(select distinct cu_code,cu_name from customer left join customerlabel on cu_code=cl_custcode)";
             cu_code.SelectField = "cu_code # 客户编号,cu_name # 客户名称";
 
             客户编号.FormName = Name;
             客户编号.SetValueField = new string[] { "客户编号" };
-            客户编号.TableName = "customer left join customerlabel on cu_code=cl_custcode";
+            客户编号.TableName = "(select distinct cu_code,cu_name from customer left join customerlabel on cu_code=cl_custcode)";
             客户编号.SelectField = "cu_code # 客户编号,cu_name # 客户名称";
 
             la_code.FormName = Name;

+ 4 - 1
UAS_Web/Browser.Designer.cs

@@ -29,13 +29,14 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Browser));
+            this.PrintFile = new System.Drawing.Printing.PrintDocument();
             this.SuspendLayout();
             // 
             // Browser
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(284, 261);
+            this.ClientSize = new System.Drawing.Size(950, 541);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Name = "Browser";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -47,6 +48,8 @@
         }
 
         #endregion
+
+        private System.Drawing.Printing.PrintDocument PrintFile;
     }
 }
 

+ 7 - 10
UAS_Web/Browser.cs

@@ -1,34 +1,28 @@
 using System;
 using System.Diagnostics;
-using System.Runtime.InteropServices;
 using System.Windows.Forms;
 using UAS_Web.tool;
 using CefSharp;
 using CefSharp.WinForms;
+using System.Text.RegularExpressions;
+using System.Collections.Generic;
 
 namespace UAS_Web
 {
     public partial class Browser : Form
     {
 
-        [DllImport("User32.dll")]
-        public static extern IntPtr GetForegroundWindow();     //获取活动窗口句柄  
-
-        [DllImport("User32.dll", CharSet = CharSet.Auto)]
-        public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);   //获取线程ID  
-
         private ChromiumWebBrowser webBrowser;
 
         public Browser()
         {
             InitializeComponent();
             Text = "思拓微-供应商条码打印";
-            string path = "http://192.168.253.6/uas_dev/jsps/vendbarcode/login.jsp";
+            string path = "http://stwecig.vicp.io:8099/ERP/jsps/vendbarcode/login.jsp";
             webBrowser = new ChromiumWebBrowser(path)
             {
                 Dock = DockStyle.Fill
             };
-            webBrowser.RegisterJsObject("", new BoundObject(), true);
             webBrowser.MenuHandler = new MenuHandler();
             webBrowser.RequestHandler = new RequestHandler();
             Controls.Add(webBrowser);
@@ -37,13 +31,16 @@ namespace UAS_Web
 
         private void WebBrowser_LoadError(object sender, LoadErrorEventArgs e)
         {
+            //指定放大镜
+            if (e.FailedUrl.Contains("vendbarcode/batchdelivery.jsp?whoami=Delivery!Deal#"))
+                return;
             MessageBox.Show("当前网络无法访问" + e.ErrorText);
         }
 
         private void Browser_FormClosing(object sender, FormClosingEventArgs e)
         {
             webBrowser.GetBrowser().CloseBrowser(true);
-            Cef.Shutdown();
+            Process.GetCurrentProcess().Kill();
         }
 
         private void Browser_Load(object sender, EventArgs e)

+ 3 - 0
UAS_Web/Browser.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="PrintFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 74 - 0
UAS_Web/PrinterList.Designer.cs

@@ -0,0 +1,74 @@
+namespace UAS_Web
+{
+    partial class PrinterList
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.Printer = new System.Windows.Forms.ComboBox();
+            this.Confirm = new System.Windows.Forms.Button();
+            this.PrintFile = new System.Drawing.Printing.PrintDocument();
+            this.SuspendLayout();
+            // 
+            // Printer
+            // 
+            this.Printer.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Printer.FormattingEnabled = true;
+            this.Printer.Location = new System.Drawing.Point(29, 38);
+            this.Printer.Name = "Printer";
+            this.Printer.Size = new System.Drawing.Size(268, 29);
+            this.Printer.TabIndex = 0;
+            // 
+            // Confirm
+            // 
+            this.Confirm.Location = new System.Drawing.Point(125, 106);
+            this.Confirm.Name = "Confirm";
+            this.Confirm.Size = new System.Drawing.Size(75, 23);
+            this.Confirm.TabIndex = 1;
+            this.Confirm.Text = "确认";
+            this.Confirm.UseVisualStyleBackColor = true;
+            //
+            // PrinterList
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(321, 170);
+            this.Controls.Add(this.Confirm);
+            this.Controls.Add(this.Printer);
+            this.Name = "PrinterList";
+            this.Text = "打印机列表";
+            this.Load += new System.EventHandler(this.PrinterList_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ComboBox Printer;
+        private System.Windows.Forms.Button Confirm;
+        private System.Drawing.Printing.PrintDocument PrintFile;
+    }
+}

+ 33 - 0
UAS_Web/PrinterList.cs

@@ -0,0 +1,33 @@
+using CefSharp;
+using System;
+using System.Drawing.Printing;
+using System.Windows.Forms;
+
+namespace UAS_Web
+{
+    public partial class PrinterList : Form
+    {
+        public IBrowser browser;
+
+        public PrintDocument PrintDoc;
+
+        public PrinterList(IBrowser br)
+        {
+            InitializeComponent();
+            browser = br;
+            PrintDoc = PrintFile;
+        }
+
+        private void PrinterList_Load(object sender, EventArgs e)
+        {
+            PrintDocument print = new PrintDocument();
+            string sDefault = print.PrinterSettings.PrinterName;//默认打印机名
+            foreach (string sPrint in PrinterSettings.InstalledPrinters)//获取所有打印机名称
+            {
+                Printer.Items.Add(sPrint);
+                if (sPrint == sDefault)
+                    Printer.SelectedIndex = Printer.Items.IndexOf(sPrint);
+            }
+        }
+    }
+}

+ 3 - 0
UAS_WebKit/Form1.resx → UAS_Web/PrinterList.resx

@@ -117,4 +117,7 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="PrintFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 37 - 2
UAS_Web/Program.cs

@@ -1,8 +1,7 @@
 using CefSharp;
 using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Security.Principal;
+using System.Text;
 using System.Windows.Forms;
 
 namespace UAS_Web
@@ -21,6 +20,10 @@ namespace UAS_Web
                 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 应用程序的主入口点
                 var setting = new CefSettings();
                 setting.CefCommandLineArgs.Add("disable-gpu", "1");
@@ -51,5 +54,37 @@ namespace UAS_Web
 
             }
         }
+
+        //处理线程的异常
+        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
+        {
+            string str = GetExceptionMsg(e.Exception, e.ToString());
+            MessageBox.Show(str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+        }
+
+        //未处理的异常统一通过这里返回
+        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+        {
+            string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
+            MessageBox.Show(str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+        }
+
+        /// <summary>
+        /// 生成自定义异常消息
+        /// </summary>
+        /// <param name="ex">异常对象</param>
+        /// <param name="backStr">备用异常消息:当ex为null时有效</param>
+        /// <returns>异常字符串文本</returns>
+        static string GetExceptionMsg(Exception ex, string backStr)
+        {
+            StringBuilder sb = new StringBuilder();
+            if (ex != null)
+            {
+                sb.AppendLine(ex.Message);
+                //sb.AppendLine("【异常方法】:" + ex.StackTrace);
+            }
+            //else { sb.AppendLine("【未处理异常】:" + backStr); }
+            return sb.ToString();
+        }
     }
 }

+ 25 - 17
UAS_Web/Properties/Settings.Designer.cs

@@ -1,30 +1,38 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace UAS_Web.Properties
-{
-
-
+namespace UAS_Web.Properties {
+    
+    
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
+    [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
-            {
+        
+        public static Settings Default {
+            get {
                 return defaultInstance;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string PrinterName {
+            get {
+                return ((string)(this["PrinterName"]));
+            }
+            set {
+                this["PrinterName"] = value;
+            }
+        }
     }
 }

+ 8 - 6
UAS_Web/Properties/Settings.settings

@@ -1,7 +1,9 @@
 <?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_Web.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="PrinterName" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+  </Settings>
+</SettingsFile>

+ 11 - 4
UAS_Web/UAS_Web.csproj

@@ -102,19 +102,25 @@
     <Compile Include="Browser.Designer.cs">
       <DependentUpon>Browser.cs</DependentUpon>
     </Compile>
+    <Compile Include="PrinterList.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="PrinterList.Designer.cs">
+      <DependentUpon>PrinterList.cs</DependentUpon>
+    </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="tool\BoundObject.cs" />
-    <Compile Include="tool\ExceptionTestBoundObject.cs" />
     <Compile Include="tool\FilterManager.cs" />
-    <Compile Include="tool\FormatterConverter.cs" />
     <Compile Include="tool\MenuHandler.cs" />
     <Compile Include="tool\MessageFilter.cs" />
+    <Compile Include="tool\PrintHelper.cs" />
     <Compile Include="tool\RequestHandler.cs" />
-    <Compile Include="tool\SubBoundObject.cs" />
     <EmbeddedResource Include="Browser.resx">
       <DependentUpon>Browser.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="PrinterList.resx">
+      <DependentUpon>PrinterList.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -125,6 +131,7 @@
       <DependentUpon>Resources.resx</DependentUpon>
       <DesignTime>True</DesignTime>
     </Compile>
+    <None Include="app.config" />
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>

+ 15 - 0
UAS_Web/app.config

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="UAS_Web.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <userSettings>
+        <UAS_Web.Properties.Settings>
+            <setting name="PrinterName" serializeAs="String">
+                <value />
+            </setting>
+        </UAS_Web.Properties.Settings>
+    </userSettings>
+</configuration>

+ 0 - 355
UAS_Web/tool/BoundObject.cs

@@ -1,355 +0,0 @@
-using CefSharp;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace UAS_Web.tool
-{
-    class BoundObject
-    {
-        public int MyProperty { get; set; }
-
-        public string MyReadOnlyProperty { get; internal set; }
-        public Type MyUnconvertibleProperty { get; set; }
-        public SubBoundObject SubObject { get; set; }
-        public ExceptionTestBoundObject ExceptionTestObject { get; set; }
-
-        public int this[int i]
-        {
-            get { return i; }
-            set { }
-        }
-
-        public uint[] MyUintArray
-        {
-            get { return new uint[] { 7, 8 }; }
-        }
-
-        public int[] MyIntArray
-        {
-            get { return new[] { 1, 2, 3, 4, 5, 6, 7, 8 }; }
-        }
-
-        public Array MyArray
-        {
-            get { return new short[] { 1, 2, 3 }; }
-        }
-
-        public byte[] MyBytes
-        {
-            get { return new byte[] { 3, 4, 5 }; }
-        }
-
-        public BoundObject()
-        {
-            MyProperty = 42;
-            MyReadOnlyProperty = "I'm immutable!";
-            IgnoredProperty = "I am an Ignored Property";
-            MyUnconvertibleProperty = GetType();
-            SubObject = new SubBoundObject();
-            ExceptionTestObject = new ExceptionTestBoundObject();
-        }
-
-        public void TestCallback(IJavascriptCallback javascriptCallback)
-        {
-            //Task.Factory.StartNew(async () =>
-            //{
-            //    using (javascriptCallback)
-            //    {
-            //        //Computer computer = new Computer();
-            //        string response = JsonConvert.SerializeObject(new
-            //        {
-            //            //cpu_id = computer.CPU_Id,
-            //            //disk_id = computer.Disk_Id,
-            //            //host_name = computer.HostName,
-            //            //networkcard = computer.NetworkCard,
-            //            //serialNumber = computer.SerialNumber_Manufacturer_Product.Item1,
-            //            //manufacturer = computer.SerialNumber_Manufacturer_Product.Item2,
-            //            //product = computer.SerialNumber_Manufacturer_Product.Item3,
-            //        });
-            //        //await javascriptCallback.ExecuteAsync(null);
-            //    }
-            //});
-            //const int taskDelay = 1500;
-            //Task.Factory.StartNew(async () =>
-            //{
-            //    await TaskEx.Delay(taskDelay);
-
-            //    using (javascriptCallback)
-            //    {
-            //        //NOTE: Classes are not supported, simple structs are
-            //        var response = new CallbackResponseStruct("This callback from C# was delayed " + taskDelay + "ms");
-            //        await javascriptCallback.ExecuteAsync(response);
-            //    }
-            //});
-        }
-
-        //public string TestCallbackFromObject(SimpleClass simpleClass)
-        //{
-        //    if (simpleClass == null)
-        //    {
-        //        return "TestCallbackFromObject dictionary param is null";
-        //    }
-
-        //    IJavascriptCallback javascriptCallback = simpleClass.Callback;
-
-        //    if (javascriptCallback == null)
-        //    {
-        //        return "callback property not found or property is not a function";
-        //    }
-
-        //    const int taskDelay = 1500;
-
-        //    TaskEx.Run(async () =>
-        //    {
-        //        await TaskEx.Delay(taskDelay);
-
-        //        if (javascriptCallback != null)
-        //        {
-        //            using (javascriptCallback)
-        //            {
-        //                await javascriptCallback.ExecuteAsync("message from C# " + simpleClass.TestString + " - " + simpleClass.SubClasses[0].PropertyOne);
-        //            }
-        //        }
-        //    });
-
-        //    return "waiting for callback execution...";
-        //}
-
-        public int EchoMyProperty()
-        {
-            return MyProperty;
-        }
-
-        public string Repeat(string str, int n)
-        {
-            string result = String.Empty;
-            for (int i = 0; i < n; i++)
-            {
-                result += str;
-            }
-            return result;
-        }
-
-        public string EchoParamOrDefault(string param = "This is the default value")
-        {
-            return param;
-        }
-
-        public void EchoVoid()
-        {
-        }
-
-        public Boolean EchoBoolean(Boolean arg0)
-        {
-            return arg0;
-        }
-
-        public Boolean? EchoNullableBoolean(Boolean? arg0)
-        {
-            return arg0;
-        }
-
-        public SByte EchoSByte(SByte arg0)
-        {
-            return arg0;
-        }
-
-        public SByte? EchoNullableSByte(SByte? arg0)
-        {
-            return arg0;
-        }
-
-        public Int16 EchoInt16(Int16 arg0)
-        {
-            return arg0;
-        }
-
-        public Int16? EchoNullableInt16(Int16? arg0)
-        {
-            return arg0;
-        }
-
-        public Int32 EchoInt32(Int32 arg0)
-        {
-            return arg0;
-        }
-
-        public Int32? EchoNullableInt32(Int32? arg0)
-        {
-            return arg0;
-        }
-
-        public Int64 EchoInt64(Int64 arg0)
-        {
-            return arg0;
-        }
-
-        public Int64? EchoNullableInt64(Int64? arg0)
-        {
-            return arg0;
-        }
-
-        public Byte EchoByte(Byte arg0)
-        {
-            return arg0;
-        }
-
-        public Byte? EchoNullableByte(Byte? arg0)
-        {
-            return arg0;
-        }
-
-        public UInt16 EchoUInt16(UInt16 arg0)
-        {
-            return arg0;
-        }
-
-        public UInt16? EchoNullableUInt16(UInt16? arg0)
-        {
-            return arg0;
-        }
-
-        public UInt32 EchoUInt32(UInt32 arg0)
-        {
-            return arg0;
-        }
-
-        public UInt32? EchoNullableUInt32(UInt32? arg0)
-        {
-            return arg0;
-        }
-
-        public UInt64 EchoUInt64(UInt64 arg0)
-        {
-            return arg0;
-        }
-
-        public UInt64? EchoNullableUInt64(UInt64? arg0)
-        {
-            return arg0;
-        }
-
-        public Single EchoSingle(Single arg0)
-        {
-            return arg0;
-        }
-
-        public Single? EchoNullableSingle(Single? arg0)
-        {
-            return arg0;
-        }
-
-        public Double EchoDouble(Double arg0)
-        {
-            return arg0;
-        }
-
-        public Double? EchoNullableDouble(Double? arg0)
-        {
-            return arg0;
-        }
-
-        public Char EchoChar(Char arg0)
-        {
-            return arg0;
-        }
-
-        public Char? EchoNullableChar(Char? arg0)
-        {
-            return arg0;
-        }
-
-        public DateTime EchoDateTime(DateTime arg0)
-        {
-            return arg0;
-        }
-
-        public DateTime? EchoNullableDateTime(DateTime? arg0)
-        {
-            return arg0;
-        }
-
-        public Decimal EchoDecimal(Decimal arg0)
-        {
-            return arg0;
-        }
-
-        public Decimal? EchoNullableDecimal(Decimal? arg0)
-        {
-            return arg0;
-        }
-
-        public String EchoString(String arg0)
-        {
-            return arg0;
-        }
-
-        // TODO: This will currently not work, as it causes a collision w/ the EchoString() method. We need to find a way around that I guess.
-        //public String echoString(String arg)
-        //{
-        //    return "Lowercase echo: " + arg;
-        //}
-
-        public String lowercaseMethod()
-        {
-            return "lowercase";
-        }
-
-        public string ReturnJsonEmployeeList()
-        {
-            return "{\"employees\":[{\"firstName\":\"John\", \"lastName\":\"Doe\"},{\"firstName\":\"Anna\", \"lastName\":\"Smith\"},{\"firstName\":\"Peter\", \"lastName\":\"Jones\"}]}";
-        }
-
-        [JavascriptIgnore]
-        public string IgnoredProperty { get; set; }
-
-        [JavascriptIgnore]
-        public string IgnoredMethod()
-        {
-            return "I am an Ignored Method";
-        }
-
-        public string ComplexParamObject(object param)
-        {
-            if (param == null)
-            {
-                return "param is null";
-            }
-            return "The param type is:" + param.GetType();
-        }
-
-        public SubBoundObject GetSubObject()
-        {
-            return SubObject;
-        }
-
-        /// <summary>
-        /// Demonstrates the use of params as an argument in a bound object
-        /// </summary>
-        /// <param name="name">Dummy Argument</param>
-        /// <param name="args">Params Argument</param>
-        public string MethodWithParams(string name, params object[] args)
-        {
-            return "Name:" + name + ";Args:" + string.Join(", ", args.ToArray());
-        }
-
-        public string MethodWithoutParams(string name, string arg2)
-        {
-            return string.Format("{0}, {1}", name, arg2);
-        }
-
-        public string MethodWithoutAnything()
-        {
-            return "Method without anything called and returned successfully.";
-        }
-
-        public string MethodWithThreeParamsOneOptionalOneArray(string name, string optionalParam = null, params object[] args)
-        {
-            return "MethodWithThreeParamsOneOptionalOneArray:" + (name ?? "No Name Specified") + " - " + (optionalParam ?? "No Optional Param Specified") + ";Args:" + string.Join(", ", args.ToArray());
-        }
-    }
-}

+ 0 - 70
UAS_Web/tool/ExceptionTestBoundObject.cs

@@ -1,70 +0,0 @@
-using CefSharp;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace UAS_Web.tool
-{
-    class ExceptionTestBoundObject
-    {
-        [DebuggerStepThrough]
-        private double DivisionByZero(int zero)
-        {
-            return 10 / zero;
-        }
-
-        [DebuggerStepThrough]
-        public double TriggerNestedExceptions()
-        {
-            try
-            {
-                try
-                {
-                    return DivisionByZero(0);
-                }
-                catch (Exception innerException)
-                {
-                    throw new InvalidOperationException("Nested Exception Invalid", innerException);
-                }
-            }
-            catch (Exception e)
-            {
-                throw new OperationCanceledException("Nested Exception Canceled", e);
-            }
-        }
-
-        [DebuggerStepThrough]
-        public int TriggerParameterException(int parameter)
-        {
-            return parameter;
-        }
-
-        public void TestCallbackException(IJavascriptCallback errorCallback, IJavascriptCallback errorCallbackResult)
-        {
-            const int taskDelay = 500;
-
-            //Task.Run(async () =>
-            //{
-            //    await TaskEx.Delay(taskDelay);
-
-            //    using (errorCallback)
-            //    {
-            //        JavascriptResponse result = await errorCallback.ExecuteAsync("This callback from C# was delayed " + taskDelay + "ms");
-            //        string resultMessage;
-            //        if (result.Success)
-            //        {
-            //            resultMessage = "Fatal: No Exception thrown in error callback";
-            //        }
-            //        else
-            //        {
-            //            resultMessage = "Exception Thrown: " + result.Message;
-            //        }
-            //        await errorCallbackResult.ExecuteAsync(resultMessage);
-            //    }
-            //});
-        }
-    }
-}

+ 22 - 6
UAS_Web/tool/FilterManager.cs

@@ -9,20 +9,36 @@ namespace UAS_Web.tool
 
         public static IResponseFilter CreateFilter(string guid)
         {
-            lock (dataList)
+            try
             {
-                var filter = new MessageFilter();
-                dataList.Add(guid, filter);
-                return filter;
+                lock (dataList)
+                {
+                    var filter = new MessageFilter();
+                    dataList.Add(guid, filter);
+                    return filter;
+                }
             }
+            catch (System.Exception e)
+            {
+                System.Console.WriteLine("插入报错" + e.Message.ToString());
+            }
+            return null;
         }
 
         public static IResponseFilter GetFileter(string guid)
         {
-            lock (dataList)
+            try
+            {
+                lock (dataList)
+                {
+                    return dataList[guid];
+                }
+            }
+            catch (System.Exception e)
             {
-                return dataList[guid];
+                System.Console.WriteLine("读取报错" + e.Message.ToString());
             }
+            return null;
         }
     }
 }

BIN
UAS_Web/tool/Fnthex32.dll


+ 0 - 93
UAS_Web/tool/FormatterConverter.cs

@@ -1,93 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-
-namespace UAS_Web.tool
-{
-    class FormatterConverter : IFormatterConverter
-    {
-        public object Convert(object value, TypeCode typeCode)
-        {
-            return value;
-        }
-
-        public object Convert(object value, Type type)
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool ToBoolean(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public byte ToByte(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public char ToChar(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public DateTime ToDateTime(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public decimal ToDecimal(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public double ToDouble(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public short ToInt16(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public int ToInt32(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public long ToInt64(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public sbyte ToSByte(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public float ToSingle(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public string ToString(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public ushort ToUInt16(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public uint ToUInt32(object value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public ulong ToUInt64(object value)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

+ 1 - 0
UAS_Web/tool/MenuHandler.cs

@@ -10,6 +10,7 @@ namespace UAS_Web.tool
     {
         public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
         {
+            browser.ShowDevTools();
             model.Clear();
         }
 

+ 124 - 0
UAS_Web/tool/PrintHelper.cs

@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace UAS_Web.tool
+{
+    class PrintHelper
+    {
+      
+        // 结构和API declarions
+        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+        public class DOCINFOA
+        {
+            [MarshalAs(UnmanagedType.LPStr)]
+            public string pDocName;
+            [MarshalAs(UnmanagedType.LPStr)]
+            public string pOutputFile;
+            [MarshalAs(UnmanagedType.LPStr)]
+            public string pDataType;
+        }
+        [DllImport("winspool.Drv", EntryPoint = "OpenPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool OpenPrinter([MarshalAs(UnmanagedType.LPStr)] string szPrinter, out IntPtr hPrinter, IntPtr pd);
+
+        [DllImport("winspool.Drv", EntryPoint = "ClosePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool ClosePrinter(IntPtr hPrinter);
+
+        [DllImport("winspool.Drv", EntryPoint = "StartDocPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool StartDocPrinter(IntPtr hPrinter, Int32 level, [In, MarshalAs(UnmanagedType.LPStruct)] DOCINFOA di);
+
+        [DllImport("winspool.Drv", EntryPoint = "EndDocPrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool EndDocPrinter(IntPtr hPrinter);
+
+        [DllImport("winspool.Drv", EntryPoint = "StartPagePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool StartPagePrinter(IntPtr hPrinter);
+
+        [DllImport("winspool.Drv", EntryPoint = "EndPagePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool EndPagePrinter(IntPtr hPrinter);
+
+        [DllImport("winspool.Drv", EntryPoint = "WritePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern bool WritePrinter(IntPtr hPrinter, IntPtr pBytes, Int32 dwCount, out Int32 dwWritten);
+
+        // SendBytesToPrinter()
+        //当函数是给定一个打印机名称和一个非托管数组
+        // 如果执行成功,将返回true;如果执行失败将返回false
+        public static bool SendBytesToPrinter(string szPrinterName, IntPtr pBytes, Int32 dwCount)
+        {
+            Int32 dwError = 0, dwWritten = 0;
+            IntPtr hPrinter = new IntPtr(0);
+            DOCINFOA di = new DOCINFOA();
+            bool bSuccess = false; // 假设失败.
+
+            di.pDocName = "My C#.NET RAW Document";
+            di.pDataType = "RAW";
+
+            // 打开打印机
+            if (OpenPrinter(szPrinterName.Normalize(), out hPrinter, IntPtr.Zero))
+            {
+                // 开始一个文档.
+                if (StartDocPrinter(hPrinter, 1, di))
+                {
+                    // 创建新页面
+                    if (StartPagePrinter(hPrinter))
+                    {
+                        // 写你的字节
+                        bSuccess = WritePrinter(hPrinter, pBytes, dwCount, out dwWritten);
+                        EndPagePrinter(hPrinter);
+                    }
+                    EndDocPrinter(hPrinter);
+                }
+                ClosePrinter(hPrinter);
+            }
+            // 如果没有成功,可能会给更多的信息GetLastError 
+            if (bSuccess == false)
+            {
+                dwError = Marshal.GetLastWin32Error();
+            }
+            return bSuccess;
+        }
+
+        public static bool SendFileToPrinter(string szPrinterName, string szFileName)
+        {
+            // 打开文件.
+            FileStream fs = new FileStream(szFileName, FileMode.Open);
+            // 创建一个主题的文件.
+            BinaryReader br = new BinaryReader(fs);
+            // .
+            Byte[] bytes = new Byte[fs.Length];
+            bool bSuccess = false;
+            // 非托管指针
+            IntPtr pUnmanagedBytes = new IntPtr(0);
+            int nLength;
+
+            nLength = Convert.ToInt32(fs.Length);
+            // 读取文件的内容放入数组中.
+            bytes = br.ReadBytes(nLength);
+            // 分配一些非托管内存对于那些字节
+            pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength);
+            // 复制管理到非托管数组的字节数组
+            Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength);
+            // 发送到打印机的非托管的字节
+            bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength);
+            // 非托管内存分配
+            Marshal.FreeCoTaskMem(pUnmanagedBytes);
+            return bSuccess;
+        }
+
+        public static bool SendStringToPrinter(string szPrinterName, string szString)
+        {
+            IntPtr pBytes;
+            Int32 dwCount;
+            // 有多少字符在字符串
+            dwCount = szString.Length;
+            // 假设打印机期待ANSI的文本,然后将字符串ANSI文本。
+            pBytes = Marshal.StringToCoTaskMemAnsi(szString);
+            // 转换后的字符串发送到打印机的ANSI
+            SendBytesToPrinter(szPrinterName, pBytes, dwCount);
+            Marshal.FreeCoTaskMem(pBytes);
+            return true;
+        }
+    }
+}

+ 96 - 19
UAS_Web/tool/RequestHandler.cs

@@ -1,43 +1,120 @@
 using CefSharp;
 using System;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Windows.Forms;
-using Newtonsoft.Json;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Text.RegularExpressions;
+using System.Windows.Forms;
 
 namespace UAS_Web.tool
 {
     class RequestHandler : IRequestHandler
     {
         public event Action<byte[]> NotifyMsg;
+         
+        string PrinterName = "";
+
+        string PrintType = "";
+
+        PrinterList print;
+        /// <summary>
+        /// 拦截指定请求
+        /// </summary>
+        /// <param name="browserControl"></param>
+        /// <param name="browser"></param>
+        /// <param name="frame"></param>
+        /// <param name="request"></param>
+        /// <param name="response"></param>
+        /// <returns></returns>
         IResponseFilter IRequestHandler.GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)
         {
-            var url = new Uri(request.Url);
-            if (url.AbsoluteUri.ToUpper().Contains(".ACTION"))
+            MessageFilter filter;
+            switch (request.Url.Substring(request.Url.LastIndexOf("/") + 1))
             {
-                var filter = FilterManager.CreateFilter(request.Identifier.ToString()) as MessageFilter;
-                //string str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
-                return filter;
+                case "default?type=printer":
+                    filter = FilterManager.CreateFilter(request.Identifier.ToString()) as MessageFilter;
+                    return filter;
+                case "zplPrint.action":
+                    filter = FilterManager.CreateFilter(request.Identifier.ToString()) as MessageFilter;
+                    return filter;
+                case "getPrintType.action":
+                    filter = FilterManager.CreateFilter(request.Identifier.ToString()) as MessageFilter;
+                    return filter;
+                default:
+                    break;
             }
             return null;
         }
 
-        void filter_NotifyData(byte[] data)
+        /// <summary>
+        /// 完成响应后获取Js返回的数据
+        /// </summary>
+        /// <param name="browserControl"></param>
+        /// <param name="browser"></param>
+        /// <param name="frame"></param>
+        /// <param name="request"></param>
+        /// <param name="response"></param>
+        /// <param name="status"></param>
+        /// <param name="receivedContentLength"></param>
+        void IRequestHandler.OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength)
+        {
+            MessageFilter filter;
+            string str;
+            Dictionary<string, object> data;
+            switch (request.Url.Substring(request.Url.LastIndexOf("/") + 1))
+            {
+                case "default?type=printer":
+                    //弹出打印机选择列表
+                    print = new PrinterList(browser) { StartPosition = FormStartPosition.CenterScreen };
+                    print.Controls["Confirm"].Click += RequestHandler_Click;
+                    print.TopMost = true;
+                    print.ShowDialog();
+                    break;
+                case "zplPrint.action":
+                    filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
+                    str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
+                    data = ToDictionary(str);
+                    //获取所有的打印格式数据
+                    string PrintCode = data["data"].ToString();
+                    List<string> PrintList = new List<string>();
+                    int PrintTime = Regex.Matches(PrintCode, "XA").Count;
+                    for (int i = 0; i < PrintTime; i++)
+                    {
+                        PrintList.Add(PrintCode.Substring(0, PrintCode.IndexOf("XZ") + 2));
+                        PrintCode = PrintCode.Substring(PrintCode.IndexOf("XZ") + 2);
+                    }
+                    for (int i = 0; i < PrintList.Count; i++)
+                    {
+                        PrintHelper.SendStringToPrinter(PrinterName, PrintList[i]);
+                    }
+                    break;
+                case "getPrintType.action":
+                    filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
+                    str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
+                    data = ToDictionary(str);
+                    PrintType = data["data"].ToString().Replace("\"","");
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void RequestHandler_Click(object sender, EventArgs e)
         {
-            NotifyMsg?.Invoke(data);
+            //设置打印机名称
+            print.PrintDoc.PrinterSettings.PrinterName = print.Controls["Printer"].Text;
+            PrinterName = print.Controls["Printer"].Text;
+            //获取矩阵图的分辨率
+            Graphics gr = print.PrintDoc.PrinterSettings.CreateMeasurementGraphics();
+            print.browser.FocusedFrame.ExecuteJavaScriptAsync("(function(value,value1){dpi=value,printType=value1})('" + gr.DpiX + "','" + PrintType + "')");
+            print.browser.FocusedFrame.ExecuteJavaScriptAsync("document.getElementById('confirmZplPrint').click();");
+            print.Close();
         }
 
-        void IRequestHandler.OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength)
+        void filter_NotifyData(byte[] data)
         {
-            if (request.Url.ToUpper().Contains(".ACTION"))
+            if (NotifyMsg != null)
             {
-                var filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
-                string str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
-                Console.WriteLine(str);
-                Dictionary<string, object> dic = ToDictionary(str);
-                filter_NotifyData(filter.dataAll.ToArray());
+                NotifyMsg(data);
             }
         }
 
@@ -97,7 +174,7 @@ namespace UAS_Web.tool
 
         public void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl)
         {
-            //Console.WriteLine("OnResourceRedirect");
+
         }
 
         bool IRequestHandler.OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)

+ 0 - 48
UAS_WebBrowser/Browser.Designer.cs

@@ -1,48 +0,0 @@
-namespace UAS_WebBrowser
-{
-    partial class Browser
-    {
-        /// <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.SuspendLayout();
-            // 
-            // Form1
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(284, 261);
-            this.Name = "Form1";
-            this.Text = "Form1";
-            this.Load += new System.EventHandler(this.Form1_Load);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-    }
-}
-

+ 0 - 22
UAS_WebBrowser/Browser.cs

@@ -1,22 +0,0 @@
-using System;
-using System.Windows.Forms;
-using WebKit;
-
-namespace UAS_WebBrowser
-{
-    public partial class Browser : Form
-    {
-        public Browser()
-        {
-            InitializeComponent();
-        }
-
-        private void Form1_Load(object sender, EventArgs e)
-        {
-            WebKit.WebKitBrowser browser = new WebKitBrowser();
-            browser.Dock = DockStyle.Fill;
-            this.Controls.Add(browser);
-            browser.Navigate("http://192.168.253.80:8090/ERP/jsps/vendbarcode/login.jsp");
-        }
-    }
-}

+ 0 - 21
UAS_WebBrowser/Program.cs

@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows.Forms;
-
-namespace UAS_WebBrowser
-{
-    static class Program
-    {
-        /// <summary>
-        /// 应用程序的主入口点。
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Browser());
-        }
-    }
-}

+ 0 - 36
UAS_WebBrowser/Properties/AssemblyInfo.cs

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

+ 0 - 71
UAS_WebBrowser/Properties/Resources.Designer.cs

@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
-//
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace UAS_WebBrowser.Properties
-{
-
-
-    /// <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 ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_WebBrowser.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;
-            }
-        }
-    }
-}

+ 0 - 117
UAS_WebBrowser/Properties/Resources.resx

@@ -1,117 +0,0 @@
-<?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.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: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" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </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" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>

+ 0 - 30
UAS_WebBrowser/Properties/Settings.Designer.cs

@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace UAS_WebBrowser.Properties
-{
-
-
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
-            }
-        }
-    }
-}

+ 0 - 7
UAS_WebBrowser/Properties/Settings.settings

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

+ 0 - 94
UAS_WebBrowser/UAS_WebBrowser.csproj

@@ -1,94 +0,0 @@
-<?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>{2737188C-1DCD-41C1-84EC-CE3831228A14}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>UAS_WebBrowser</RootNamespace>
-    <AssemblyName>UAS_WebBrowser</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>x86</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>
-  <ItemGroup>
-    <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" />
-    <Reference Include="WebKit.Interop, Version=533.0.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <EmbedInteropTypes>True</EmbedInteropTypes>
-      <HintPath>bin\Debug\WebKit.Interop.dll</HintPath>
-    </Reference>
-    <Reference Include="WebKitBrowser, Version=0.5.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>bin\Debug\WebKitBrowser.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Browser.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Browser.Designer.cs">
-      <DependentUpon>Browser.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="Browser.resx">
-      <DependentUpon>Browser.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>
-    </Compile>
-    <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>
-  <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>

BIN
UAS_WebBrowser/tool/Xilium.CefGlue.WindowsForms.dll


BIN
UAS_WebBrowser/tool/Xilium.CefGlue.dll


+ 0 - 50
UAS_WebKit/Form1.Designer.cs

@@ -1,50 +0,0 @@
-namespace UAS_WebKit
-{
-    partial class Form1
-    {
-        /// <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.SuspendLayout();
-            // 
-            // Form1
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(284, 261);
-            this.Name = "Form1";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Form1";
-            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
-            this.Load += new System.EventHandler(this.Form1_Load);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-    }
-}
-

+ 0 - 21
UAS_WebKit/Program.cs

@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows.Forms;
-
-namespace UAS_WebKit
-{
-    static class Program
-    {
-        /// <summary>
-        /// 应用程序的主入口点。
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
-        }
-    }
-}

+ 0 - 36
UAS_WebKit/Properties/AssemblyInfo.cs

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

+ 0 - 71
UAS_WebKit/Properties/Resources.Designer.cs

@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
-//
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace UAS_WebKit.Properties
-{
-
-
-    /// <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 ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_WebKit.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;
-            }
-        }
-    }
-}

+ 0 - 117
UAS_WebKit/Properties/Resources.resx

@@ -1,117 +0,0 @@
-<?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.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: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" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </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" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>

+ 0 - 30
UAS_WebKit/Properties/Settings.Designer.cs

@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace UAS_WebKit.Properties
-{
-
-
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
-            }
-        }
-    }
-}

+ 0 - 7
UAS_WebKit/Properties/Settings.settings

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

+ 0 - 94
UAS_WebKit/UAS_WebKit.csproj

@@ -1,94 +0,0 @@
-<?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>{E22C6A79-BBE5-427D-A4F9-B11D2B5EEFFA}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>UAS_WebKit</RootNamespace>
-    <AssemblyName>UAS_WebKit</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>x86</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>
-  <ItemGroup>
-    <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" />
-    <Reference Include="WebKit.Interop, Version=533.0.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <EmbedInteropTypes>True</EmbedInteropTypes>
-      <HintPath>bin\Debug\WebKit.Interop.dll</HintPath>
-    </Reference>
-    <Reference Include="WebKitBrowser, Version=0.5.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>bin\Debug\WebKitBrowser.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="Form1.resx">
-      <DependentUpon>Form1.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>
-    </Compile>
-    <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>
-  <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>