N
nywjx
Unregistered / Unconfirmed
GUEST, unregistred user!
用clientsocket连接局域网里的网络接口设备Set TimePC发送:24 02 06 09 02 13 16 17 2D 23PC接收:24 04 00 23 发送部分的代码如下:var SBuf:array [0..10] of Byte;begin SBuf[1]:=byte($24); SBuf[2]:=byte($02); SBuf[3]:=byte($06); SBuf[4]:=byte($09); SBuf[5]:=byte($02); SBuf[6]:=byte($13); SBuf[7]:=byte($16); SBuf[8]:=byte($17); SBuf[9]:=byte($2D); SBuf[10]:=byte($23); ClientSocket.Socket.SendBuf(SBuf,11);end;但是好像没反应嘛接收部分的代码如下:procedure TChatForm.ClientSocketRead(Sender: TObject; Socket: TCustomWinSocket);var i:integer; temp,temp1:string;begin temp:=Socket.ReceiveText; temp1:=''; for i := 1 to Length(temp) do begin try temp1:=temp1+IntToHex(StrToInt(temp),2) + ' '; except Beep; end; end; Memo2.Lines.Add(temp1);end;也接收不到。是不是什么地方写错了?请各位指正