add save method

This commit is contained in:
Zontreck 2020-03-10 12:44:43 -07:00
parent b513cb6a1d
commit ce7d1fe4b0
2 changed files with 11 additions and 4 deletions

View file

@ -81,5 +81,12 @@ namespace Bot
} }
} }
public void Save()
{
SerialManager sm = new SerialManager();
sm.Write<MainConfiguration>("Main", this);
sm = null;
}
} }
} }

View file

@ -52,13 +52,13 @@ namespace Bot
if (args[0] == "-a") if (args[0] == "-a")
{ {
conf.ActivationCode = args[1]; conf.ActivationCode = args[1];
SM.Write<MainConfiguration>("Main", conf); conf.Save();
return; return;
} }
else if (args[0] == "-m") else if (args[0] == "-m")
{ {
conf.MainProgramDLL = args[1]; conf.MainProgramDLL = args[1];
SM.Write<MainConfiguration>("Main", conf); conf.Save();
return; return;
} }
} }
@ -69,7 +69,7 @@ namespace Bot
conf.first = args[1]; conf.first = args[1];
conf.last = args[2]; conf.last = args[2];
conf.password = args[3]; conf.password = args[3];
SM.Write<MainConfiguration>("Main", conf); conf.Save();
return; return;
} }
} }
@ -187,7 +187,7 @@ namespace Bot
conf.first = fna; conf.first = fna;
conf.last = lna; conf.last = lna;
conf.password = pwd; conf.password = pwd;
SM.Write<MainConfiguration>("Main", conf); conf.Save();
} }
else else
{ {