在特定时间做一些后台任务 [英] Do some background task on particular time

查看:66
本文介绍了在特定时间做一些后台任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,您只想在特定时间在我的应用程序中执行一些后台任务,而用户可以通过我的应用程序进行设置.

Hi just want to do some background task in my app on a particular time which user can set through my app.

我没有获得可以帮助我的确切API和类.

I am not getting exact API and classes which can help me.

我了解了BackgroundTaskAgent,Scheduler任务等信息,但没有获得如何在用户设置的确切时间和日期上运行应用程序.

I read about BackgroundTaskAgent,Scheduler task etc. but not getting how to run app on exact time and date which user will set.

有任何建议或想法吗?如果有人可以为此提供一些重要的链接,请这样做.

Any suggestion or Idea? If any one can give some important link regarding this so please do.

预先感谢!

sumita

推荐答案

您找不到API,因为它们不存在.  无法在特定的日期/时间运行代码.  您所能做的最好的事情就是实现一个后台代理,并让它将系统时间与隔离存储中存储的时间进行比较. 当它由操作系统运行时(大约每半小时一次).  如果时间很相近,请运行代码.  不是,如果用户不再次启动您的应用程序,则该功能仅在接下来的14天内有效.
You aren't finding the APIs because they don't exist.  There is no way to run your code at a specific date/time.  The best you can do is implement a background agent and have it compare the system time against a time stored in isolated storage when it gets run by the OS (approximately every half hour).  If the times are a close match, run the code.  Not that this will only work for a date within the next 14 days if the user does not launch your app again.


这篇关于在特定时间做一些后台任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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