From 060c42efbc1fee881dd4e02cbd3298b1d57307ac Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Thu, 15 Jul 2021 22:45:05 +0800 Subject: [PATCH] Import Windows.Win32.UI.WindowsAndMessaging.SHOW_WINDOW_CMD --- Netch/Netch.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Netch/Netch.cs b/Netch/Netch.cs index 03852a5d..29ac49d5 100644 --- a/Netch/Netch.cs +++ b/Netch/Netch.cs @@ -15,12 +15,16 @@ using Netch.Services; using Netch.Utils; using Serilog; using Serilog.Events; +using SingleInstance; +#if RELEASE +using Windows.Win32.UI.WindowsAndMessaging; +#endif namespace Netch { public static class Netch { - public static readonly SingleInstance.SingleInstanceService SingleInstance = new($"Global\\{nameof(Netch)}"); + public static readonly SingleInstanceService SingleInstance = new($"Global\\{nameof(Netch)}"); internal static HWND ConsoleHwnd { get; private set; } @@ -41,7 +45,7 @@ namespace Netch Updater.CleanOld(Global.NetchDir); // 预创建目录 - var directories = new[] {"mode\\Custom", "data", "i18n", "logging"}; + var directories = new[] { "mode\\Custom", "data", "i18n", "logging" }; foreach (var item in directories) if (!Directory.Exists(item)) Directory.CreateDirectory(item); @@ -95,6 +99,7 @@ namespace Netch Application.SetCompatibleTextRenderingDefault(false); Application.Run(Global.MainForm); } + private static void LogEnvironment() { Log.Information("Netch Version: {Version}", $"{UpdateChecker.Owner}/{UpdateChecker.Repo}@{UpdateChecker.Version}");