c#: public void sendMessage(string userEP, string message)
{
try
{
//message += "\r\n";
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(message.ToCharArray());
//buffer[buffer.Length] = 0;
clients[userEP].Sock.Send(buffer, buffer.Length, 0);
}
catch (Exception e)//如果有异常则退出
{
}
}
VB6:Private Sub sock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim a() As Byte
ReDim a(bytesTotal) As Byte
sock.GetData a, vbByte
strDate = StrConv(a, vbUnicode)
结果VB6在显示中文时乱码,请问各位如何解决呢?谢谢!
{
try
{
//message += "\r\n";
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(message.ToCharArray());
//buffer[buffer.Length] = 0;
clients[userEP].Sock.Send(buffer, buffer.Length, 0);
}
catch (Exception e)//如果有异常则退出
{
}
}
VB6:Private Sub sock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim a() As Byte
ReDim a(bytesTotal) As Byte
sock.GetData a, vbByte
strDate = StrConv(a, vbUnicode)
结果VB6在显示中文时乱码,请问各位如何解决呢?谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货