开发者

How to call Windows application using Windows service in C#?

I have created a Windows service with using that开发者_开发问答 service. How will I call a Windows application?


Windows services and Windows applications are completely different programs. Windows services are automatically started when the computer boots, have no user interface and have different security context than logged in user. You can't simply convert a Windows application to a Windows service (and expect it to run smoothly). If you want your program to always run (24/7) with no user interface then you can look into Windows services.

More on Windows services: "Windows Service vs Windows Application - Best Practice" and "Windows Service Applications".


You have to pick a Windows service from the project type in Visual Studio. If you meant how can you host an application as a Windows service, the only way to do this is to create a new project of type Windows Service and use the Process class.

You can then create an install class and then use installutil or alternatively, use sc from the command line to install it.


Hey, you can easily run ANY application as Windows service with this utility - Application As Service by Eltima

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜