Sockets编程中的NetStream传送
中文汉字的问题!!!急啊 用Socket连接后通过编码Encoding.Default.GetString(readBuffer) -》 传输NetworkStream.Write -》 解码Encoding.Default.GetString(readBuffer) 汉字是乱码 __________________________________________________________________________ Encoding.GetEncoding( "gb2312 ").GetString(readBuffer)也还是乱码 __________________________________________________________________________
解决啦 __________________________________________________________________________ 你要在传输到NetworkStream.Write的时候,把带有
中文的字符串进行转换后再传输。 这样就可避免出现乱码了。 __________________________________________________________________________ ......................... __________________________________________________________________________ 楼主???? __________________________________________________________________________ 接分,谢谢。 __________________________________________________________________________ 先编码。 __________________________________________________________________________ 关注 __________________________________________________________________________