这是最简单的通讯问题呀。这是原来的一个测试例子客户端的:ClientSocket1.Address := EdtIP.Text; ClientSocket1.Port := StrToInt(EdtPort.Text); ClientSocket1.Active := true; Sleep(100); Application.ProcessMessages; Sleep(100); Application.ProcessMessages; ss := '51' + Space('', 16) + Space(Edit4.Text, 15, 1) + Edit1.Text + Edit5.Text + Edit6.Text + Space(Edit2.Text, 8) + Space(Edit7.Text, 4); Data := ''; for i := 1 to StrToInt(Edit7.Text) do begin Data := Data + Space(StringGrid1.Cells[1, i] , 30); Data := Data + Space(StringGrid1.Cells[2, i] , 30); Data := Data + Space(StringGrid1.Cells[3, i] , 15, 1); Data := Data + Space(StringGrid1.Cells[4, i] , 15); Data := Data + Space(StringGrid1.Cells[5, i] , 15, 1); end; i := Length(Data); if i > 0 then begin i := Length(ss + Data); Data := ss + Data; end; Data := Copy('00000', 0, 5 - Length(IntToStr(i))) + IntToStr(i) + Data + #10; Operate := 3; ClientSocket1.Socket.SendText(Data);服务端的是C++的。不发了。