Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
取消注册uwp后台任务_Uwp_Background Task - Fatal编程技术网

取消注册uwp后台任务

取消注册uwp后台任务,uwp,background-task,Uwp,Background Task,我注册了一个后台任务,当某个设置被停用时,我尝试再次注销它。但我只找到了有关注册和调度任务的信息。没有办法吗 这就是你要找的吗 var tasks = BackgroundTaskRegistration.AllTasks; foreach(var task in tasks) { // You can check here for the name string name = tas

我注册了一个后台任务,当某个设置被停用时,我尝试再次注销它。但我只找到了有关注册和调度任务的信息。没有办法吗

这就是你要找的吗

var tasks = BackgroundTaskRegistration.AllTasks;
            foreach(var task in tasks)
            {
                // You can check here for the name
                string name = task.Value.Name;

                task.Value.Unregister(true);
            }