用户名空白检测+修复一重大bug

This commit is contained in:
2026-02-24 20:09:10 +08:00
parent 0386511a00
commit e0e7da7ac2
5 changed files with 31 additions and 20 deletions

View File

@@ -55,7 +55,7 @@ namespace CMLeonOS
private static bool ContainsInvalidChars(string input)
{
char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*', '/', '\\' };
char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*', '/', '\\', ' ' };
foreach (char c in invalidChars)
{
if (input.Contains(c.ToString()))
@@ -405,7 +405,7 @@ namespace CMLeonOS
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Username contains invalid characters: < > : \" | ? / \\ ");
global::System.Console.Write("Username contains invalid characters: < > : \" | ? * / \\ space");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Username: ");