udp Client 接收不到中文 !。。。。。。。。。。

lucbesson 2004-12-15 02:26:27
byte[] receiveBytes=receive.Receive(ref RemoteIpEndPoint);
//Conver the data
string returnData=Encoding.ASCII.GetString(receiveBytes,0,receiveBytes.Length);
if(returnData=="exit") break;
string message=DateTime.Now.ToString ()+"\r\n"+returnData+"\n";
this.richTextBox1.AppendText(message);


-------------------------------------------------
server发送中文的时候,client接收到的:?????
问题出现在什么地方 ?。。。。。。。。。。。
...全文
120 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
龍过鸡年 2004-12-15
  • 打赏
  • 举报
回复
服务器端: byte[] bytes = Encoding.Unicode.GetBytes(message)
客户端: string message = Encoding.Unicode.GetString(bytes, 0, bytes.Length);
lucbesson 2004-12-15
  • 打赏
  • 举报
回复
再不顶

就沉了 。。。。。。。。。。。

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧