在控制台中从Windows服务显示消息

编程入门 行业动态 更新时间:2024-10-27 06:29:01
本文介绍了在控制台中从Windows服务显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我双击我的服务器exe它运行作为控制台应用程序,我可以看到控制台中的日志。 我使用在 http://代码给出的代码进行了Windows服务。 msdn.microsoft/windowsdesktop/CppWindowsService-cacf4948 使用此服务器在后台运行,但我看不到控制台。任何人都可以告诉我如何通过服务向控制台发送消息。

When i double click on my server exe it runs as a console application and i can see the logs in console. I have made a windows service using the code given at code.msdn.microsoft/windowsdesktop/CppWindowsService-cacf4948 Using this the server runs in background but i cant see the console. Can anyone tell me how can i send messages to the console from a service??

谢谢!

推荐答案

我将我的日志从我的服务打印到管道句柄,我只是写了一个简单的管道客户端读取文件并将其显示在控制台中。 如果任何人需要代码,然后在这里发布。

Got it! I print my logs from my service to a pipe handle and i just wrote a simple pipe client which reads the file and displays it in the console. If anyone needs the code then ill post it here

谢谢!

更多推荐

在控制台中从Windows服务显示消息

本文发布于:2023-11-06 09:39:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563335.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   消息   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!