如何创建将在桌面上运行控制台窗口的Windows服务 [英] How can I create a Windows Service that will run a console window on the desktop

查看:123
本文介绍了如何创建将在桌面上运行控制台窗口的Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建可以在桌面上打开控制台的服务?我之前从未做过任何服务。请指教。

How can I create a service that can keep a console open on the desktop? I have never done any services before. Please advice.

推荐答案

试试如何使用控制台模式编写.NET Windows服务 [ ^ ]。


很明显你需要使用

while(true){...}



while(Console.ReadKey()。KeyChar!='someKeyChar'){...}



-KR
It's a quite obvious that you need to use
while(true) { ... }
or
while (Console.ReadKey().KeyChar !='someKeyChar') { ... }

-KR


这篇关于如何创建将在桌面上运行控制台窗口的Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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