本文介绍了在另一个线程中运行表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的c#项目中有五种形式。一个主机是一个httplistener,我想持续运行。当侦听器得到消息时,它将它传递给一个静态类,然后调用适当的表单进行另一个处理。
i have five forms in my c# project. one host an httplistener that i want to run continionsly. when the listener gets a message, it passes it to a static class, which in turn calls the appropriate forms for another processing.
有可能静态类调用新线程中的新形式?如果是这样,请帮我解决
is it possible that the static class calls the new form in a new thread? if so please help me out
推荐答案表单中的代码应该只处理表单的视觉方面。其他任何东西,尤其是http侦听器,都应该使用在后台线程上运行的独立类来处理。
The code in the forms should only deal with the visual aspects of the form. Anything else,especially http listeners, should be handled with separate classes running on background threads.
更多推荐
在另一个线程中运行表单
发布评论