在另一个线程中运行表单

编程入门 行业动态 更新时间:2024-10-23 05:38:30
本文介绍了在另一个线程中运行表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的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.

更多推荐

在另一个线程中运行表单

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

发布评论

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

>www.elefans.com

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