在rpi上使用UWP应用程序设置Systemtime [英] Set Systemtime with an UWP app on rpi

查看:99
本文介绍了在rpi上使用UWP应用程序设置Systemtime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Hi,

我有问题设置SystemTime我有这个代码:

I have the Problem to set the SystemTime i have this Code:

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

我会得到一个例外:  'System.UnauthorizedAccessException'

I will get an exception: 'System.UnauthorizedAccessException'

感谢您的帮助:)

推荐答案

Hello ÜberDaniel,

Hello ÜberDaniel,

如果您的项目引用了IoT UWP扩展,并且您拥有

系统管理功能
,您可以通过此方法设置日期和时间。

If you have the IoT UWP extensions referenced by your project, and you have the System Management capability added to your Package.appxmanifest, you can set the Date and Time via this method.

最好的问候,

Michael


这篇关于在rpi上使用UWP应用程序设置Systemtime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆