using CPF.Cef; using CPF.Linux;//如果需要支持Linux才需要 using CPF.Mac;//如果需要支持Mac才需要 using CPF.Platform; using CPF.Skia; using CPF.Windows; using System; using System.Net.Sockets; using System.Threading.Tasks; using System.Threading; using System.IO; namespace AKS.EnterpriseLibrary.WebBrowser { class Program { [STAThread] static void Main(string[] args) { Application.Initialize( (OperatingSystemType.Windows, new WindowsPlatform(), new SkiaDrawingFactory()) , (OperatingSystemType.OSX, new MacPlatform(), new SkiaDrawingFactory())//如果需要支持Mac才需要 , (OperatingSystemType.Linux, new LinuxPlatform(), new SkiaDrawingFactory())//如果需要支持Linux才需要 ); CefRuntime.Load(); var mainArgs = new CpfCefMainArgs(args); var app = new CpfCefApp(); var exitCode = CefRuntime.ExecuteProcess(mainArgs, app, IntPtr.Zero); if (exitCode != -1) { return; } CefRuntime.Initialize(mainArgs, new CefSettings { }, app, IntPtr.Zero); var model = new MainModel(); Application.Run(new FrmMain { DataContext = model, CommandContext = model }); CefRuntime.Shutdown(); } } }