Add Reboot to IPMonitor
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user