[UWP] [C#]如何在后台定期检查任务? [英] [UWP][C#]How to regularly check a task in Background?

查看:67
本文介绍了[UWP] [C#]如何在后台定期检查任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我正在使用Geofence创建一个应用程序,以便在我来或离开某个位置时打开/关闭Wifi。但我不希望Geofence一直在节省电池。我想为Geofence创建活动时间。

I'm create an app using Geofence to turn on/or turn off Wifi when I come or leave a location. But I don't want Geofence always on to save Battery. I want to create active time for that Geofence.

例如:我只希望Geofence在每天上午7:00到下午5:00或每周某天活动

Ex: I only want Geofence active from 7:00AM to 5:00PM everyday or someday in week

喜欢这个应用程序  GeoSetr

Like this app GeoSetr

谢谢!

推荐答案

嗨Nguyen_Thanh_Liem,

Hi Nguyen_Thanh_Liem,

>> ;"我只希望Geofence在每天上午7:00到下午5:00或每周某天活动"

>>" I only want Geofence active from 7:00AM to 5:00PM everyday or someday in week"

没有内置触发器供您注册后台任务并将其从固定时间激活到另一个固定时间。

There’s no built-in trigger for you to register a background task and make it active from a fixed time to another fixed time.

对于您的问题,您可以使用LocationTriggerType注册后台任务以接收地理围栏事件。然后,当触发后台任务时,您可以决定是否按当前日期时间继续执行以下操作。 

For your question, you could use LocationTriggerType to register a background task to receive geofencing events. Then, when the background task is triggered, you could decide whether to proceed with the following actions by the current date time. 

最好的问候,

Xavier Eoro

Xavier Eoro


这篇关于[UWP] [C#]如何在后台定期检查任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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