发送端:SendBuf[5]:=100; (100为标示字符。。)
现要判断后,指定位置接收。。
 len:=socket.ReceiveLength;
   socket.ReceiveBuf(sendbuf,len);
   if sendbuf[5]=100 then
   begin
   edit1.Text:=string(temparray[1]);
   end;
给位帮小弟看看好么?深表谢意。。

解决方案 »

  1.   

    不是保存。先显示就行。。
    serversocket接收数据。对应端口已设好。
      

  2.   

    @:lionser
    -直接用SOCKET比较好,这样封装后做简单的应用反而复杂
      

  3.   

    发送端:SendBuf[5]:=100; (100为标示字符。。) 
    现要判断后,指定位置接收。。 
    len:=socket.ReceiveLength; 
      socket.ReceiveBuf(sendbuf,len); 
      if sendbuf[5]=100 then 
      begin 
      edit1.Text:=string(temparray[1]); 
      end; 
    给位帮小弟看看好么?深表谢意。。 
    ----------------------------------
    看不懂, temparray 哪里冒出来的? 
      

  4.   

      if ord(sendbuf[5])=100 then 
      

  5.   

     SendBuf,temparray是两个数组。。
    现在procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
      Socket: TCustomWinSocket);
    var
      temparray:array[0..30] of single;
      SendBuf:array [0..30] of single;
      len:integer;
    begin
       len:=socket.ReceiveLength;
       socket.ReceiveBuf(sendbuf,len);
       Move( SendBuf[0],temparray[0], SizeOf(single) * 30);
      //Move(sendbuf[0], temparray[0], 30);   if sendbuf[5]=100 then
       begin
       edit1.Text:=string(temparray[2]);
       end;end;
    需要把数组赋值
    求正解
    谢谢各位师傅谢谢
      

  6.   

    其实你这样问的话我不知道这么回答,因为我不知道你接收到底是什么东西,也就是对方给你传的到底是什么,为什么数组都是single的,然后最后又干这事呢edit1.Text:=string(temparray[2]); 要做也是
    edit1.Text:=floattostr(temparray[2])啊,所以你把你想要的功能和对方发来的数据的形式说出来,代码我想大家肯定会帮你的; 
      

  7.   

    感谢hexpate解决困扰我很久的问题谢谢