请问各位大侠用在client中传输自定义数据类型时如何在server中接收(100分)

  • 主题发起人 主题发起人 wangyise
  • 开始时间 开始时间
W

wangyise

Unregistered / Unconfirmed
GUEST, unregistred user!
小弟写了如下代码:
client:
type csdata=record
message_hand:string;
message_file_lag:integer;
end;
var
Form1: TForm1;
data:csdata;
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

begin
clientsocket1.active:=true;
clientSocket1.Socket.SendBuf(data, sizeof(data));

edit1.SelectAll;
end;

end.
server:
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
p:pchar;
length:longint;
count,i:integer;
begin
p:=nil;
socket.receivebuf(p^,socket.receivelength);

end;
请问如何才能调用该类型中的参数
 
帮忙小弟等待中
 
后退
顶部