Can an app written with .net Compact Framework restart itself?

时光怂恿深爱的人放手 提交于 2019-12-03 08:35:55

Absolutely. It's actually way easier to do than on the desktop. If you're using the SDF, use this:

var thisName = Assembly.GetExecutingAssembly().GetName().CodeBase;
var time = DateTime.Now.AddSeconds(11);
Notify.RunAppAtTime(thisName, time);

If you want to do it manually, you'd p/invoke CeRunAppAtTime.

Note that you must have a launch time of > 10 (not >= 10) seconds in the future or the "launch will happen immediately (an artifact of how the default notification setup is set in the kernel).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!