Restart through code on windows 10 uwp

We created a Windows 10 application that runs on tablets in the Windows 10 kiosk mode. It works very well, but the Wi-Fi connection is sometimes lost because the locations are very remote. We tried to fix the problem from the network side, but when the devices lose and restore access to the Internet, the application will still hang, as if it does not have access to the Internet, displaying a blank page. Where these devices are used, they are bolted to the wall to prevent theft. This means that if we want to reboot it a lot of time, since we need to unscrew the cases from the wall, and then open the cases to access the power button, and the only way to return the application successfully again is to reboot the device.

It has been suggested that we have a way to reboot from the application, however, each sample code I tried does not work in Windows 10 UWP. Here are the most common ones:

System.Diagnostics.Process.Start("restart", "/r");

I have access to the namespace

System.Diagnostics

but the class Process does not exist. Does anyone have any suggestions on rebooting through code in Win 10 UWP? Or the best solution to our problem? Thanks in advance.

It is also worth mentioning that I tried to execute the Powershell command, and dll, I need to refer to the Powershell class, which is not compatible with UWP.

+3
source share
1 answer

, , API-, UWP. . , , , .

, . , PInvoke, , . .

+3

Source: https://habr.com/ru/post/1605853/


All Articles