zoukankan
html css js c++ java
调用另一个form显示出来就没有了响应
程序思想如下:
------------------------------
原来的程序
------------------------------
Form Load时创建一个新的进程并且开始执行
listenerRun
=
true
;
thread
=
new
Thread(
new
ThreadStart(Listen));
thread.Start();
这个进程所执行的Listen的内容如下:
private
void
Listen()
{
try
{
tcpl
=
new
TcpListener(tcpPort);
tcpl.Start();
while
(listenerRun)
{
Socket s
=
tcpl.AcceptSocket();
Byte[] strem
=
new
byte
[
80
];
int
i
=
s.Receive(strem);
string
message
=
System.Text.Encoding.UTF8.GetString(strem);
TBContent.AppendText(message);
Thread floatThread
=
new
Thread(
new
ThreadStart(ShowFloat));
floatThread.Start();
}
}
catch
(System.Security.SecurityException)
{
MessageBox.Show(
"
防火墙安全错误
"
,
"
Error
"
,MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
}
监听从端口tcpPort接收到的信息,可以成功
我想设置成每接受一条消息就显示另外一个Form
所以程序就改成了
while
(listenerRun)
{
Socket s
=
tcpl.AcceptSocket();
Byte[] strem
=
new
byte
[
80
];
int
i
=
s.Receive(strem);
string
message
=
System.Text.Encoding.UTF8.GetString(strem);
TBContent.AppendText(message);
FloatForm floatform
=
new
FloatForm();
floatform.Show();
}
可是这里这个floatform显示出来就没有了响应
是floatform没有响应,不是主程序没有响应
这是为什么呢?
查看全文
相关阅读:
【设计模式】 五大原则
RFC
Linux虚拟服务器--LVS
Git fast forward提交
Fighting regressions with git bisect---within git bisect algorithm
Git bare repo with multiple branches
英特尔和Red Hat合作实现Gnome桌面的Wayland支持
如何成为一个Linux内核开发者
Terminal emulator
bootstrap基础学习【网格系统】(三)
原文地址:https://www.cnblogs.com/index/p/56742.html
最新文章
【转】jmeter入门教程- Jmeter教程及技巧汇总
【转】appium常用方法整理
web sec / mail check
OS + Windows 10 / smb
hd + Huawei Router WS860S
OS + Windows / winsoft
OS + Windows / vmware 15 pro
springBoot+微信公众号开发
使用nssm以windows服务的形式启动springBoot项目
windows下将ES和kibana作为服务启动
热门文章
SpringBoot迁移数据库数据到ES+操纵ES进行高级检索源码
springBoot整合ES操作这一篇就够了
【数据库】 SQLite 语法
【数据库】 SQLite 介绍
【网络爬虫】 预备知识
【C#】 语法糖
【设计模式】 感想
【设计模式】 类和接口
【设计模式】 简单工厂
【设计模式】 单例模式
Copyright © 2011-2022 走看看