Browse Source

忽略证书安全,修改获取打印机action

章政 7 năm trước cách đây
mục cha
commit
1504c14d61
3 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 2 1
      UAS_Web/PrinterList.Designer.cs
  2. 1 1
      UAS_Web/Program.cs
  3. 2 2
      UAS_Web/tool/RequestHandler.cs

+ 2 - 1
UAS_Web/PrinterList.Designer.cs

@@ -35,6 +35,7 @@
             // 
             // Printer
             // 
+            this.Printer.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             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);
@@ -50,7 +51,7 @@
             this.Confirm.TabIndex = 1;
             this.Confirm.Text = "确认";
             this.Confirm.UseVisualStyleBackColor = true;
-            //
+            // 
             // PrinterList
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 1 - 1
UAS_Web/Program.cs

@@ -25,7 +25,7 @@ namespace UAS_Web
                 //处理非UI线程异常
                 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                 #region 应用程序的主入口点
-                var setting = new CefSettings();
+                var setting = new CefSettings() { IgnoreCertificateErrors = true };
                 setting.CefCommandLineArgs.Add("disable-gpu", "1");
                 Cef.Initialize(setting);
                 Application.EnableVisualStyles();

+ 2 - 2
UAS_Web/tool/RequestHandler.cs

@@ -30,7 +30,7 @@ namespace UAS_Web.tool
             MessageFilter filter;
             switch (request.Url.Substring(request.Url.LastIndexOf("/") + 1))
             {
-                case "default?type=printer":
+                case "zplPrinter":
                     filter = FilterManager.CreateFilter(request.Identifier.ToString()) as MessageFilter;
                     return filter;
                 case "zplPrint.action":
@@ -62,7 +62,7 @@ namespace UAS_Web.tool
             Dictionary<string, object> data;
             switch (request.Url.Substring(request.Url.LastIndexOf("/") + 1))
             {
-                case "default?type=printer":
+                case "zplPrinter":
                     //弹出打印机选择列表
                     print = new PrinterList(browser) { StartPosition = FormStartPosition.CenterScreen };
                     print.Controls["Confirm"].Click += RequestHandler_Click;