是否可以制作 WinRT 服务 [英] Is it possible to make a WinRT service

查看:21
本文介绍了是否可以制作 WinRT 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

既然WinRT有独特的能力,不知道是不是要做一个针对WinRT的Windows Service?如果不可能,是否有可能实现不可见的 WinRT/Metro 应用程序的解决方法?

Since WinRT have unique capabilities, I wonder if it were to make a Windows Service that is targeted to WinRT? If it were not possible, is the workaround to make an invisible WinRT/Metro application possible?

非常感谢.

推荐答案

否是正确答案.Metro 应用程序在 Metro shell 和执行容器内执行,该容器创建一个远离系统资源(包括服务)的沙箱.因此,地铁应用程序无法访问本地服务.同样,出于这个原因,地铁应用程序不能成为服务.

No is the correct answer. A metro application executes inside the Metro shell and inside an execution container that creates a sandbox away from system resources, including services. For this reason a metro app cannot access a local service. Similarly, for this reason, a metro app cannot be a service.

后台任务和通过 Windows 通知服务推送通知是 Metro 应用在非活动状态下与用户交互的唯一方式.否则,当应用程序不活动(不可见)时,它的所有线程都将挂起(与服务不同).

Background tasks and push notifications through Windows Notification Services are the only way for a metro app to interact with the user while not active. Otherwise, when the application is not active (not visible), all of its threads are suspended (unlike a service).

至于后台任务,它们的活动受限于 Metro 应用程序,并且每 2 小时限制为一个 CPU 秒(有一个例外).推送通知可以更频繁地执行,但只能更新磁贴或引发 Toast 通知.

As for background tasks, their activity is constrained identically to a metro app and limited to a single CPU second every 2 hours (there is one exception). Push notifications can execute more frequently, but are only capable of updating a tile or raising a toast notification.

Metro 应用程序的意图不同于传统的桌面应用程序:

The intent of a metro application is different than a traditional desktop application:

Metro 应用程序是独立于架构的(在 intel 或 arm 上运行).Metro 应用程序是触摸范围的,专为触摸屏设计.Metro 应用程序是完全硬件加速的.Metro 应用程序利用经过认证的设备提供的下一代硬件,包括前所未有的电池寿命.Metro 应用程序是 Windows 商店提供的唯一应用程序.

Metro applications are architecture independent (run on intel or arm). Metro applications are touch-reach, built for touch screens. Metro applications are fully hardware accelerated. Metro applications leverage the next gen hardware that certified devices offer, including unprecedented battery life. Metro applications are the only applications delivered by the Windows store.

看,选择 Metro 应用程序确实意味着要放弃桌面应用程序的一些无限功能.但是,收益也很显着.

Look, choosing a metro application does mean to concede some of the unlimited power of desktop applications. However, the gains are significant, too.

这篇关于是否可以制作 WinRT 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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