控制台应用程序,打开一个新的窗口,通过后台工作开始每个线程 [英] Console app that opens a new window for each thread started by background worker

查看:598
本文介绍了控制台应用程序,打开一个新的窗口,通过后台工作开始每个线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启动多个不同线程的控制台应用程序。主控制台应用程序将查询服务,并根据答复,将使用BackgroundWorker类产卵一个或多个后台线程。目前,这些线程做一个console.writeline的唯一默认的控制台窗口中打开,因为它一般不会为一个控制台应用程序。这使得它太混乱遵循任何一个线程的进度。

I have a console application that starts multiple different threads. The main console app will poll a service and based on responses it will spawn one or more background threads using the BackgroundWorker class. At the moment each of these threads do a console.writeline to the sole default console window opened as it normally does for a console application. This makes it too confusing to follow the progress of any one thread.

我希望能够生成一个单独的窗口中与他们每个人的书写自己的console.writeline(),以自己的窗口。完成后,主控制台应用程序窗口将关闭催生控制台窗口,然后当它需要重新启动它。

I want to be able to spawn a separate window with each of them writing their own console.writeline() to their own windows. When done, the main console app window will close the spawned console window, and then start it up again when it needs to.

我一直没能找到任何这种网上非常有用。林可能没有使用正确的关键字在我的搜索。任何帮助这个好吗?

I have not been able to find anything useful on this online. Im probably not using the correct keywords in my search. Any help in this please?

推荐答案

作为后续行动,以弗拉基米尔评论这里有一个很好的示例应用程序,演示了安装,并从控制台分离和改变显示的颜色和位置,并有一些C#库围绕打造Windows控制台API。

As a follow up to Vladimir's comments there's a nice sample app here that demonstrates attaching and detaching from a console and changing the display colors and locations and has some c# libraries build around the Windows Console API.

http://www.mischel.com/dia​​ry/2006/08/ 19.htm

这篇关于控制台应用程序,打开一个新的窗口,通过后台工作开始每个线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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