UtilPowerLogOff Method

Shuts down all processes running in the logon session and then logs off the interactive user.

Definition

Namespace: DevCase.Core.IO.Devices.Power
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static bool LogOff(
	LogOffMode mode = LogOffMode.ForceIfHung,
	ShutdownReason reason = ShutdownReason.Other,
	bool ignoreErrors = true
)

Parameters

mode  LogOffMode  (Optional)
Indicates whether to force the logoff.
reason  ShutdownReason  (Optional)
The reason for initiating the shutdown.
ignoreErrors  Boolean  (Optional)
If , a Win32Exception exception will be thrown if error found.

Return Value

Boolean
If the function succeeds, the return value is .

The function executes asynchronously so a return value indicates that the shutdown has been initiated.

It does not indicate whether the shutdown will succeed. It is possible that the system, the user, or another application will abort the shutdown.

If the function fails, the return value is .

Exceptions

Win32Exception

See Also