这是我的代码,请大家帮忙procedure TForm2.idtcpsrvr1Execute(AContext: TIdContext); var lread,lwrt,s1,s2: string; res,res1:string; i:Integer; Adata:TmemoryStream; begin AData:=TmemoryStream.Create; AContext.Connection.IOHandler.ReadStream(Adata,-1,False); lread:=Adata.ToString; // lread:=AContext.Connection.IOHandler; mmo1.Lines.add(lread); writememo(AContext.Connection.Socket.Binding.PeerIP+'<>接受其发送的数据是:'+lread); if True then begin try sver:=SplitString(lread,'|'); finally end; if sver[8]='0494516' then begin if sver[22]='123456' then begin res1:='00'; res:=''; end else begin res1:='99'; res:='TVR0303'; end; end else begin res1:='99'; res:='TVR0013'; end; writememo(lwrt); for i := 1 to 17 do begin s1:=s1+sver+'|' ; end; for i := 21 to 25 do begin s2:=s2+sver+'|'; end; lwrt:='0210|'+s1+res+'|'+sver[19]+'|'+res1+'|'+s2; mmo1.lines.add(lwrt); // lwrt:='123|13|ctb2426.exe'; AContext.Connection.IOHandler.WriteLn(lwrt); writememo(AContext.Connection.Socket.Binding.PeerIP+'<>向其发送的数据是:'+lwrt); end; end;