Hi,
I want to create an application which works when system is shutting down. So, my question is that is it right way to implement Environment.HasShutdownStarted property for my propose..?
SystemEvents.SessionEnding +=
new SessionEndingEventHandler(SystemEvents_SessionEnding);
void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
{
if (Environment.HasShutdownStarted)
{
//…………………………
}
else
{
//………………
}
}