日期:2014-05-17 浏览次数:22218 次
_RecordsetPtr Rp=connect.GetRecordset(sql);
_variant_t varUserName;
string strUserName;
varUserName = Rp->GetCollect ("TICKETCODE");//票号
strUserName=strUserName+(char *)_bstr_t(varUserName);
strUserName=rtrim(strUserName);
send(clientSocket,strUserName.c_str(),strUserName.length(),0);
string response = "something";
SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
socketEventArg.RemoteEndPoint = _socket.RemoteEndPoint;
socketEventArg.SetBuffer(new Byte[MAX_BUFFER_SIZE], 0, MAX_BUFFER_SIZE);
socketEventArg.Completed += new EventHandler<SocketAsyncEventArgs>(delegate(object s, SocketAsyncEventArgs e)
response = Encoding.UTF8.GetString(e.Buffer, e.Offset, e.BytesTransferred);//个人猜测是这里设置编码有问题
response = response.Trim('\0');
response = Encoding.unicode.GetString(e.Buffer, e.Offset, e.BytesTransferred);