From f2bb61df43b13492e896dd297eaecff138a9e5eb Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 2 Feb 2026 16:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B2=A1=E6=9C=89=E7=94=A8=E5=93=88=E5=B8=8C=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E7=9A=84bug&FirstTimeSetup=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UserSystem.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/UserSystem.cs b/UserSystem.cs index 815d4ee..95cdfbc 100644 --- a/UserSystem.cs +++ b/UserSystem.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Text; +using System.Threading; +using Sys = Cosmos.System; namespace CMLeonOS { @@ -213,8 +215,19 @@ namespace CMLeonOS SaveUsers(); ShowSuccess("Admin user created successfully!"); - // 创建用户文件夹 - CreateUserFolder(username); + Console.WriteLine(); + Console.WriteLine("System will restart in 3 seconds..."); + Console.WriteLine("Please wait..."); + Console.WriteLine(); + + for (int i = 3; i > 0; i--) + { + Console.Write($"\rRestarting in {i} seconds... "); + Thread.Sleep(1000); + } + + Console.WriteLine("\rRestarting now! "); + Sys.Power.Reboot(); } catch (Exception ex) { @@ -407,7 +420,7 @@ namespace CMLeonOS User newUser = new User { Username = username, - Password = password, + Password = HashPasswordSha256(password), IsAdmin = isAdmin }; users.Add(newUser);