From 258aab30f8c19c30deca6f05a6ead48933e55bd0 Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Fri, 6 Jun 2025 17:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=9C=E5=8F=B0=E9=97=9C=E6=A9=9F=E6=8C=89?= =?UTF-8?q?=E9=88=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrimaryFormParts/PrimaryForm.SequenceManager.cs | 9 ++++++--- PrimaryFormParts/PrimaryForm.cs | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/PrimaryFormParts/PrimaryForm.SequenceManager.cs b/PrimaryFormParts/PrimaryForm.SequenceManager.cs index a8c2da5..de03646 100644 --- a/PrimaryFormParts/PrimaryForm.SequenceManager.cs +++ b/PrimaryFormParts/PrimaryForm.SequenceManager.cs @@ -15,6 +15,7 @@ namespace DualScreenDemo { if (currentSequence[currentSequence.Count - 1] != correctSequence[currentSequence.Count - 1]) { + Console.WriteLine(currentSequence[currentSequence.Count - 1] +" 比對 " + correctSequence[currentSequence.Count - 1] +" 順序錯誤,重置序列"); // 順序錯誤,重置序列 currentSequence.Clear(); return; @@ -26,14 +27,16 @@ namespace DualScreenDemo { try { + Console.WriteLine("使用 Windows 命令關機"); // 使用 Windows 命令關機 - System.Diagnostics.Process.Start("shutdown", "/s /t 0"); + new System.Threading.Thread(() => + { + System.Diagnostics.Process.Start("shutdown", "/s /t 0"); + }).Start(); } catch (Exception ex) { MessageBox.Show($"關機失敗: {ex.Message}"); - // 如果關機失敗,退出程式 - Application.Exit(); } } } diff --git a/PrimaryFormParts/PrimaryForm.cs b/PrimaryFormParts/PrimaryForm.cs index 2ebefd8..79503a3 100644 --- a/PrimaryFormParts/PrimaryForm.cs +++ b/PrimaryFormParts/PrimaryForm.cs @@ -336,21 +336,25 @@ namespace DualScreenDemo } private void buttonMiddle_Click(object sender, EventArgs e) { + Console.WriteLine("巨"); sequenceManager.ProcessClick("巨"); } private void buttonTopRight_Click(object sender, EventArgs e) { + Console.WriteLine("級"); sequenceManager.ProcessClick("級"); } private void buttonTopLeft_Click(object sender, EventArgs e) { + Console.WriteLine("超"); sequenceManager.ProcessClick("超"); } private void buttonThanks_Click(object sender, EventArgs e) { + Console.WriteLine("星"); sequenceManager.ProcessClick("星"); }