beta,我写的读出代码:
procedure StreamToMsgPart(Stream: TMemoryStream; Mp: TIDMessageParts);
procedure ReadString(Stream: TMemoryStream; Str: string);
var
Size:integer;
begin
stream.Read(Size,4);
stream.Read(str,size);
end;
procedure ReadInteger(Stream: TMemoryStream; Int: Integer);
begin
Stream.Read(int,4);
end;
var
i,ls: Integer;
begin
stream.Position:=0;
for i := 0 to mp.Count - 1 do
begin
ReadString(Stream,mp.ContentTransfer);
ReadString(Stream,mp.ContentType);
ReadString(Stream,mp.ExtraHeaders.text);
ReadString(Stream,mp.ExtraHeaders.NameValueSeparator);
ReadInteger(Stream,ls);
mp.ExtraHeaders.CaseSensitive:=chr(ls);
ReadInteger(Stream,ls);
mp.ExtraHeaders.UnfoldLines:=chr(ls);
ReadInteger(Stream,ls);
mp.ExtraHeaders.FoldLines:=chr(ls);
ReadInteger(Stream,mp.ExtraHeaders.FoldLength);
end;
end;