当我双击我的服务器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服务显示消息
发布评论