什么是一个Windows服务和常规应用程序之间的区别? [英] What is the difference between a windows service and a regular application?

查看:1693
本文介绍了什么是一个Windows服务和常规应用程序之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只创建了普通的Windows应用程序(C#居多)。有什么区别,从一个普通的Windows应用程序窗口服务?是什么让他们有什么不同?有什么可以服务做到这一点的应用程序不能?什么是从开发商看到的差异的观点?你如何创建?难道仅仅是创建一个普通的应用程序(控制台应用程序也许,由于没有鬼?),然后运行,或以特殊的方式安装,或者是更是有许多工作要做?

I have only created regular windows applications (C# mostly). What differentiates a windows service from a regular windows application? What makes them different? What can a service do that an application can't? What are the differences seen from a developers point of view? How do you create one? Is it just to create a regular application (Console application maybe, since there are no gui?) and run or install it in a special way, or is it more that has to be done?

推荐答案

有一对夫妇的事情,立即跳出了我。

There are a couple of things that jump out to me immediately.


  • 它们运行在一个完全不同的控制台开始与Vista

  • 作为在不同的控制台中运行的结果是,服务无法与桌面交互。所以基本上没有直接的UI支持。通常,您必须编写,它运行作为一个正常的程序,并使用了一些机制(命名管道为例)与该服务进行通信的兄弟UI应用程序。

  • 通常只是你的服务的一个实例可以在任何给定时间运行。

  • 流程是每个用户,服务是每个工作站,因此常常为多个用户提供服务。

  • They run in an entirely different console starting with Vista
  • As a result of running in a different console, services cannot interact with the desktop. So essentially there is no direct UI support. You typically have to code a sibling UI application that does run as a normal program and uses some mechanism (named pipes for example) to communicate with the service.
  • Typically only one instance of your service can be running at any given time.
  • Processes are per user, services are per work station and hence often provide services for multiple users.

这篇关于什么是一个Windows服务和常规应用程序之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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