tumblr tracker

WasRestarted

Library Reference ›› System ››
Parent Previous Next

System.WasRestarted


Namespace: System


Checks whether the system was recently restarted.


retval = System.WasRestarted([Minutes])


Parameters:

- [Minutes]; optional, default is 60; numeric value; checks if the system was restarted in the last [Minutes] minutes


Returns:

True if the system was restarted, false otherwise; boolean value.


Example


$Minutes = 120;

//checks whether the system was restarted in the last two hours
If (System.WasRestarted($Minutes))
{
   MessageBox.ShowInfo("System was restarted in the last " + $Minutes);
}