简体   繁体   English

如何在 Raspberry PI 上使用 UWP 应用程序设置 SystemTime

[英]How to use an UWP Application on Raspberry PI to set the SystemTime

I get an exception if i run this Code on a RPI with W10iotCore:如果我使用 W10iotCore 在 RPI 上运行此代码,则会出现异常:

Windows.System.DateTimeSettings.SetSystemDateTime(new DateTime(sometime));

like喜欢

System.UnauthorizedAccessException: Access is denied. System.UnauthorizedAccessException:访问被拒绝。

I understand this exception but how can I run this Code with the Access to change the DateTime of the System?我了解此异常,但如何使用 Access 运行此代码以更改系统的日期时间?

That means on the debug Version in VisualStudion (still on the rpi) and the Normal runtime Environment of the App.这意味着在 VisualStudion 中的调试版本(仍在 rpi 上)和应用程序的正常运行时环境。

The Background: I am Building a weatherstation with the possibility to not have an Internet connection.背景:我正在构建一个可能没有 Internet 连接的气象站。 For the time Setting I will use an DCF77 Receiver for setting the SystemTime on Startup or the updateability on clicking a Button.对于时间设置,我将使用 DCF77 接收器来设置启动时的 SystemTime 或单击按钮时的可更新性。

This function requires the "System Management" capability, which you can set in your appxmanifest .此功能需要“系统管理”功能,您可以在appxmanifest设置。

截屏

See here and here .请参阅此处此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用C#UWP应用程序控制Raspberry Pi的音量 - Control Volume of Raspberry Pi with C# UWP Application UWP Raspberry Pi Webserver问题 - UWP Raspberry Pi Webserver issue 如何在Raspberry Pi 2上将Windows Services与Mongodb结合使用 - How to Use Windows Services with Mongodb on Raspberry Pi 2 如何使用MS-IoT Lightning设置/获取Raspberry Pi2的PWM? - How to use MS-IoT Lightning to set/get PWM with Raspberry Pi2? 是否可以将 Raspberry Pi 3 上的 Windows 10 IoT UWP C# 应用程序连接到蓝牙耳机? - Is it possible to connect a Windows 10 IoT UWP C# application on a Raspberry Pi 3 to a bluetooth headset? 无法将UWP应用部署到Raspberry Pi 3 - Cannot deploy UWP app to raspberry pi 3 UWP 在 Raspberry Pi 上使用 FullTrustesdLauncher 启动 EXE - UWP start EXE with FullTrustesdLauncher on Raspberry Pi 如何从AC#应用程序将终端命令发送到树莓派 - How to send terminal commands to a raspberry pi from a c# application 如何使用Windows 10 IoT(UWP)为Raspberry Pi 3创建可移植代码(.net标准2.0)? - How to create portable code (.net standard 2.0) for a Raspberry Pi 3 using Windows 10 IoT (UWP)? 如何从UWP应用程序中运行物联网核心的Raspberry Pi访问网络共享 - How to access Network Share from Raspberry Pi running IoT Core in UWP app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM