X
xywen
Unregistered / Unconfirmed
GUEST, unregistred user!
有一个记录类型数据:
Type
TDictate=record
DictateType:string;
DictateText:string;
end;
发送:
var
SendDictate:TDcitate;
begin
SendDictate.DictateType:='Login';
SendDictate.DictateText:='UserName';
ClientSocket1.Socket.SendBuf(SendDictate,SizeOf(SendDictate));
end;
接收:
var
ReceiveDictate:TDictate;
begin
ServerSocket1.Sokcet.ReceiveBuf(ReceiveDictate,SizeOf(ReceiveDictate));
Showmessage(ReceiveDictate.DictateType);//这里会出错
Showmessage(ReceiveDictate.DictateText);//这里会出错
end;
请问我该如何使用TClientSocket和TServerSocket将该记录发送和接收?
Type
TDictate=record
DictateType:string;
DictateText:string;
end;
发送:
var
SendDictate:TDcitate;
begin
SendDictate.DictateType:='Login';
SendDictate.DictateText:='UserName';
ClientSocket1.Socket.SendBuf(SendDictate,SizeOf(SendDictate));
end;
接收:
var
ReceiveDictate:TDictate;
begin
ServerSocket1.Sokcet.ReceiveBuf(ReceiveDictate,SizeOf(ReceiveDictate));
Showmessage(ReceiveDictate.DictateType);//这里会出错
Showmessage(ReceiveDictate.DictateText);//这里会出错
end;
请问我该如何使用TClientSocket和TServerSocket将该记录发送和接收?