不太清除,帮您UP!
'D','#','E' 是不是回车之类的东西呀

解决方案 »

  1.   

    因为chr是char类型,你把chr转化成string类型看看 
      

  2.   

    把 ms.write(str, length(str)); 改为 ms.write(str[1], length(str));
      

  3.   

    var
      str: string; 
      ms: Tmemorystream;
      chr: char;
      i: integer;
      b_byte:byte;
    begin
      ms := Tmemorystream.create;
      try
        str := '111';
        ms.position := 0;
        for i:=1 to 3 do
        begin
            b_byte:=ord(str[i-1]);
            ms.write(b_byte, 1);
        end;
        //ms.write(str, length(str));
        ms.position := 0;
        for i := 1 to 3 do
        begin
          ms.read(chr, 1);
          showmessage(chr);
        end;
      finally
        ms.free;
      end;
    end;