使用C#创建一个Windows服务资源

使用C#创建一个Windows服务资源

本文介绍了使用C#创建一个Windows服务资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

有谁知道任何良好的资源和文章,可以解释如何创建一个使用C#的窗口服务。
感谢

does anyone knows any good resources and articles that can explain how to create windows services using c#.thanks

推荐答案

我建议你谷歌的不同部分,在网络上不同的地方有不同的信息焦点(和水平先进的最新信息)。你需要知道有关这些主题:

I'd suggest you Google for the different parts, different places on the web have different information focus (and level of up-to date info). You need to know about these topics:


  • Windows服务背景介绍:在Windows中如何服务工作。看看他们如何在关于用户界面的不同,系统权限(占服务下运行的,什么是它的权限),启动/关闭,以及用户反馈。

  • Windows Service backgrounders: How services work in Windows. See how they are different in regards to user interface, system privileges (which account the service runs under, and what are its privileges), startup/shutdown, and user feedback.

您可能要在服务做的一件事是使用Timer控件做周期性任务。 正常的定时器,你把窗口的形式并不在一个部门工作,因为控制必须以UI窗口(其中,服务缺乏)一起使用。你必须使用一个System.Timer控制。谷歌这更多信息。我把这个在这里,因为你会浪费好几个小时不知道为什么你的计时器不工作,我们都已经写服务都通过这个

One thing you may want to do in a service is use a Timer control to do periodic tasks. The "normal" Timer that you put on window forms does NOT work in a service because that control must be used with a UI window (which a service lacks). You have to use a System.Timer control. Google this for more info. I put this here because you will waste several hours wondering why your timer does not work, all of us that have written Services have gone through this!

调试! - 你如何调试服务?有几个选项

Debugging - How do you debug a service? There are several options.

部署 - 一个服务的安装比一个Windows应用程序的不同,多了几分复杂。这不是一个很大的谜,有一个简单的几件事情更担心与用户

Deployment - Installation of a service is different and a little more involved than that of a Windows app. It's not a great mystery, there are simply a couple things more to worry about.

互动 - 服务不使用的用户界面,所以怎么都你打算让你的用户来控制服务(配置,启动/停止,查看日志,等等)。

Interaction with the user - Services do not use a UI, so how are you going to enable your user to control the service (configure, start/stop, view log, etc...).

这是一些浮现在脑海中,如果你对这些东西读了,你应该确定的主题。

These are some of the topics that come to mind, if you read up on these things, you should be OK.

我还建议测试您服务在虚拟机上部署,这样你就可以知道一个事实,即你的设置工作。

I'd also recommend testing your service deployments on a virtual machine so you can know for a fact that your setup works.

这篇关于使用C#创建一个Windows服务资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 00:17