SVN r1148

SVN-Revision: r1148
This commit is contained in:
cyf
2026-03-23 01:47:22 +00:00
parent eb0522e144
commit d8ac361255
14 changed files with 188 additions and 116 deletions
+12 -1
View File
@@ -17,6 +17,8 @@ using System.Reflection;
using System.IO;
using Lskj.Control.BrowserSetting;
using Microsoft.Win32;
using System.Resources;
using System.Runtime.InteropServices;
namespace Lskj.Main
{
@@ -26,12 +28,15 @@ namespace Lskj.Main
//private static extern bool SetProcessDpiAwarenessContext(IntPtr dpiContext);
//private static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = new IntPtr(-4);
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
CefRuntime.Load();//cef浏览器模块设置加载
var mainArgs = new CefMainArgs(args);
@@ -81,6 +86,7 @@ namespace Lskj.Main
catch (Exception ex)
{
MessageUtil.Show(ex);
LogHelper.Instance.WriteError(ex);
}
}
@@ -113,6 +119,9 @@ namespace Lskj.Main
commandLine.AppendSwitch("resources-dir-path", path);
commandLine.AppendSwitch("locales-dir-path", Path.Combine(path, "locales"));
commandLine.AppendSwitch("ignore-certificate-errors", "1");
commandLine.AppendSwitch("allow-running-insecure-content", "1");
//如果注册表中CefMultithreading不为1,并且根目录中不存在BrowserMultithreading.txt"文件,就是单线程模式
//只要有一个条件满足就是多线程模式
if (!BrowserMultithreading() && !File.Exists(PubUtil.AbsolutelyPath + "BrowserMultithreading.txt"))
@@ -146,7 +155,9 @@ namespace Lskj.Main
/// <param name="e">The <see cref="ThreadExceptionEventArgs"/> instance containing the event data.</param>
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
MessageUtil.Show(e.Exception);
// 获取异常对象
Exception ex = e.Exception;
MessageUtil.Show(ex);
LogHelper.Instance.WriteError(e.Exception);
}