Add Reboot to IPMonitor

This commit is contained in:
2025-09-07 19:27:24 -04:00
parent 74faf75452
commit 9a964bb7ec
2 changed files with 74 additions and 7 deletions

View File

@@ -27,6 +27,31 @@ namespace MarketData.Utils
return false;
}
/// <summary>
/// Restarts the computer ARM64
/// -r = restart the computer
/// </summary>
public static void Reboot()
{
string arguments = "-r now";
string shutdownProcess = "shutdown";
ProcessStartInfo processStartInfo = new ProcessStartInfo(shutdownProcess, arguments)
{
CreateNoWindow = true,
UseShellExecute = false
};
try
{
MDTrace.WriteLine(LogLevel.DEBUG,$"Executing {shutdownProcess} {arguments}");
Process.Start(processStartInfo);
}
catch (Exception exception)
{
MDTrace.WriteLine(LogLevel.DEBUG,$"An error was encountered executing the command: {shutdownProcess} {arguments}");
MDTrace.WriteLine(LogLevel.DEBUG,$"{exception.ToString()}");
}
}
public static String ThreadStateToString(Thread thread)
{
switch(thread.ThreadState)