This repository has been archived on 2025-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
KTVApp/App.xaml.cs

25 lines
676 B
C#
Raw Normal View History

2025-03-18 11:16:57 +08:00
using System;
using System.Windows;
using System.Runtime.InteropServices;
namespace KTVApp
{
public partial class App : Application
{
[DllImport("kernel32.dll")]
static extern bool AllocConsole();
static extern bool FreeConsole();
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
AllocConsole(); // 分配控制台
Console.Title = "KTVApp Debug Console";
Console.WriteLine("應用程式已啟動...");
}
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
FreeConsole();
}
}
}