Reputation: 23
I get an exception if i run this Code on a RPI with W10iotCore:
Windows.System.DateTimeSettings.SetSystemDateTime(new DateTime(sometime));
like
System.UnauthorizedAccessException: Access is denied.
I understand this exception but how can I run this Code with the Access to change the DateTime of the System?
That means on the debug Version in VisualStudion (still on the rpi) and the Normal runtime Environment of the App.
The Background: I am Building a weatherstation with the possibility to not have an Internet connection. For the time Setting I will use an DCF77 Receiver for setting the SystemTime on Startup or the updateability on clicking a Button.
Upvotes: 2
Views: 218
Reputation: 241420
This function requires the "System Management" capability, which you can set in your appxmanifest
.
Upvotes: 1