public void Receive()
{
Form2 new_form2 = new Form2();
while (true)
{
Byte[] Receive = new byte[64];
NetworkStream Net_stream = new NetworkStream(new_form2.Acc_Socket1);
Net_stream.Read(Receive, 0, Receive.Length);//读取客户发送来的信息。
string RecMessage = System.Text.Encoding.BigEndianUnicode.GetString(Receive);
richTextBox1.AppendText(RecMessage + "\r\n");//写入到接收信息栏中。
}
}
上面是程序的部分代码
我用中断的方式看到RecMessage中是有数据的,但到下面就显示不出来,在richtextbox中的text中显示RecMessage的内容
{
Form2 new_form2 = new Form2();
while (true)
{
Byte[] Receive = new byte[64];
NetworkStream Net_stream = new NetworkStream(new_form2.Acc_Socket1);
Net_stream.Read(Receive, 0, Receive.Length);//读取客户发送来的信息。
string RecMessage = System.Text.Encoding.BigEndianUnicode.GetString(Receive);
richTextBox1.AppendText(RecMessage + "\r\n");//写入到接收信息栏中。
}
}
上面是程序的部分代码
我用中断的方式看到RecMessage中是有数据的,但到下面就显示不出来,在richtextbox中的text中显示RecMessage的内容
解决方案 »
- 三维数组赋值问题
- C# C/s linkLabel控件样式问题
- 反序列化中的面向接口思路?
- 怎么样子才能不刷新
- 调用exe文件时,如果判断这个exe文件执行完了
- 未能加载标题为[Method Override Stud]的代码段。请确认在代码段管理器中对重构代码段进行了识别,并且磁盘上的代码段文件有效。
- 用C#写服务器程序,比如流媒体服务器,可以不?谁能回答?
- 用System.Xml.XmlTextWriter创建XML的问题
- 按照需要生成EAN13标准的条形码!求帮忙!!
- 请问如何在C#打开如,ToolBarImages.resources
- DataTable 遍历行 无限级分类
- 内存流MemoryStream是干什么用的,给个简单点的例子好吗?
你在这个
richTextBox1.AppendText(RecMessage + "\r\n");//写入到接收信息栏中。
下面加个
Application.DoEvents();试试
说不定就可以了
这个是value,都是能看到的就是不能显示
public static void GetTextValue(string tem_str)
{
Form1 new_form1=new Form1();
new_form1.richTextBox1 .AppendText(tem_str);
}
我这样建的,还是不行,郁闷