增加设置项MaxLoginAttempts(默认3)

This commit is contained in:
2026-02-28 19:39:48 +08:00
parent c5fc081977
commit ec7e0978d3
6 changed files with 64 additions and 5 deletions

View File

@@ -58,6 +58,18 @@ namespace CMLeonOS.Commands
Console.WriteLine("Error: LoggerEnabled must be 'true' or 'false'");
}
}
else if (key.ToLower() == "maxloginattempts")
{
if (int.TryParse(value, out int attempts) && attempts > 0)
{
SettingsManager.MaxLoginAttempts = attempts;
Console.WriteLine($"MaxLoginAttempts set to {attempts}");
}
else
{
Console.WriteLine("Error: MaxLoginAttempts must be a positive integer");
}
}
else
{
SettingsManager.SetSetting(key, value);