25 lines
676 B
C#
25 lines
676 B
C#
|
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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|