From 28d12750238d510b24cf955d854a451a5d945e54 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Sat, 22 Mar 2025 23:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=AC=E5=BC=80=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/Program.cs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/SpineViewer/Program.cs b/SpineViewer/Program.cs index 0d668ed..9b97608 100644 --- a/SpineViewer/Program.cs +++ b/SpineViewer/Program.cs @@ -5,13 +5,38 @@ namespace SpineViewer { internal static class Program { - public const string Name = "SpineViewer"; + /// + /// 程序路径 + /// + public static readonly string FilePath = Environment.ProcessPath; + + /// + /// 程序名 + /// + public static readonly string Name = Path.GetFileNameWithoutExtension(FilePath); + + /// + /// 程序目录 + /// + public static readonly string RootDir = Path.GetDirectoryName(FilePath); + + /// + /// 程序临时目录 + /// public static readonly string TempDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Name)).FullName; + + /// + /// 程序进程 + /// public static readonly Process Process = Process.GetCurrentProcess(); + + /// + /// 程序日志器 + /// public static readonly Logger Logger = LogManager.GetCurrentClassLogger(); /// - /// The main entry point for the application. + /// 应用入口点 /// [STAThread] static void Main()