拍单功能继续优化
This commit is contained in:
1 parent
29042424dc
commit
34c51c6fcd
64 files changed
+7138
-305
No files matched your search
@@ -1,8 +1,11 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using CefSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -18,6 +21,7 @@ namespace _29WxOrderWpf
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
public static int ProcessCount = 0;
|
||||
public static string[] args = new List<string>().ToArray();
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
@@ -67,6 +71,35 @@ namespace _29WxOrderWpf
|
||||
//BaseMsgForm.ShowError(str, "系统错误");
|
||||
BaseMsgWindow.ShowError(null, str, "系统错误");
|
||||
}
|
||||
|
||||
#region 初始化cef
|
||||
CefSharpSettings.WcfEnabled = false;
|
||||
|
||||
CefSharp.Wpf.CefSettings settings = new CefSharp.Wpf.CefSettings();
|
||||
settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
|
||||
settings.CefCommandLineArgs.Add("disable-gpu", "1"); // 禁止显卡加速
|
||||
settings.IgnoreCertificateErrors = true;
|
||||
settings.Locale = "zh-CN";
|
||||
settings.LogSeverity = LogSeverity.Disable;
|
||||
|
||||
var pName = Process.GetCurrentProcess().ProcessName;
|
||||
ProcessCount = Process.GetProcesses().Count(p => p.ProcessName == pName);
|
||||
//138版cef自己不会分缓存,会因占用导致报错,手动分缓存
|
||||
settings.CachePath = Path.Combine(Environment.CurrentDirectory, "Cache\\Order" + ProcessCount);
|
||||
//settings.CachePath = null; //禁止缓存
|
||||
//settings.CefCommandLineArgs.Add("enable-javascript", "1");
|
||||
//settings.CefCommandLineArgs.Add("disable-features", "NetworkService,NetworkServiceInProcess");
|
||||
settings.CefCommandLineArgs.Add("--disable-web-security", "1");
|
||||
//settings.CefCommandLineArgs.Add("--disable-request-handling-for-testing", "1");
|
||||
#if DEBUG
|
||||
settings.LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cef_log_order.txt");
|
||||
// 设置日志级别为详细
|
||||
settings.LogSeverity = LogSeverity.Verbose;
|
||||
// 捕获JavaScript异常堆栈(最多32帧)
|
||||
settings.UncaughtExceptionStackSize = 32;
|
||||
#endif
|
||||
Cef.Initialize(settings);
|
||||
#endregion
|
||||
}
|
||||
|
||||
//static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
|
||||
Reference in new issue
Block a user