Building on my previous articles (Windows 10 IoT Core: Starting a Package on Raspberry Pi  and Windows 10 IoT Core: Getting the MAC Address from Raspberry Pi) the following functions will shutdown and reboot the Raspberry Pi running Windows 10 IoT Core.

private
async void ShutdownComputer()

{

String URL = "http://localhost:8080/api/control/shutdown";

System.Diagnostics.Debug.WriteLine(URL);

StreamReader SR = await PostJsonStreamData(URL);

}

private async void RebootComputer()

{

String URL = "http://localhost:8080/api/control/reboot";

System.Diagnostics.Debug.WriteLine(URL);

StreamReader SR = await PostJsonStreamData(URL);

}

The function PostJsonStreamData() can be found in Windows 10 IoT Core: Starting a Package on Raspberry Pi.

 

 

Copyright © 2015 – Bruce Eitman and Embedded101.com
All Rights Reserved