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没有响应,不是主程序没有响应
这是为什么呢?
查看全文
相关阅读:
如何定义开发完成?(Definition of Done)
Git协同工作流介绍
Git常用命令拾遗
搭建基于Docker社区版的Kubernetes本地集群
Mqtt学习指南
JavaWeb 学习总结
异常:org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
MySQL 插入中文错误:java.sql.SQLException: Incorrect string value:
Servlet 中文乱码问题解析及详细解决方法
常用正则表达式
原文地址:https://www.cnblogs.com/index/p/56742.html
最新文章
Redis对象——字符串
Spring Boot(四) Mybatis-MySql
Spring Boot(三) 使用Lombok
Spring Boot(二) 配置文件
文章导航-readme
Spring Boot(一) Hello World
Redis对象——Redis对象系统简介
MySql 更新死锁问题 Deadlock found when trying to get lock; try restarting transaction
互联网公司面试经——你不得不知道的哈希表
Redis数据结构——压缩列表
热门文章
API规范约定
代码规范值钱吗?分享内部不成熟的代码规范做法。
Vue学习笔记:Vuex
Vue学习笔记:提升开发效率和体验的常用工具
Vue学习笔记:Vue组件的核心概念(下)
Vue学习笔记:Vue组件的核心概念(上)
Vue学习笔记:基础篇之vue入门
使用Jenkins部署.Net Core遇到的几个坑
数据可视化工具调研和选型
浅谈技术管理之个体能力建设
Copyright © 2011-2022 走看看