mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
增加设置项MaxLoginAttempts(默认3)
This commit is contained in:
@@ -11,7 +11,8 @@ namespace CMLeonOS.Settings
|
||||
|
||||
private static Dictionary<string, string> defaultSettings = new Dictionary<string, string>
|
||||
{
|
||||
{ "LoggerEnabled", "true" }
|
||||
{ "LoggerEnabled", "true" },
|
||||
{ "MaxLoginAttempts", "3" }
|
||||
};
|
||||
|
||||
public static bool LoggerEnabled
|
||||
@@ -31,6 +32,26 @@ namespace CMLeonOS.Settings
|
||||
}
|
||||
}
|
||||
|
||||
public static int MaxLoginAttempts
|
||||
{
|
||||
get
|
||||
{
|
||||
if (settings.TryGetValue("MaxLoginAttempts", out string value))
|
||||
{
|
||||
if (int.TryParse(value, out int result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
set
|
||||
{
|
||||
settings["MaxLoginAttempts"] = value.ToString();
|
||||
SaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadSettings()
|
||||
{
|
||||
settings.Clear();
|
||||
|
||||
Reference in New Issue
Block a user