how to sign out from windows 10 program in uwp?
问题 how to log off(sign out) windows 10 using uwp? I have do in win-forms but codes are not working in uwp. [DllImport("user32.dll")] public static extern int ExitWindowsEx(int operationFlag, int rationReason); private void button_Click(object sender, RoutedEventArgs e) { //Application.Current.Exit(); ExitWindowsEx(0, 0); } 回答1: In non-UWP programme You can create a new process and run %windir%\System32\shutdown.exe /l /t 0 But this is not available to UWP programmes. Check out the Stack Overflow