我是如下这样定义文件头的, 但压缩文件有上百个或更多, 我现在压缩完后,需要修改第二个 var SaleSoftID:string; // (长度为12)我只需要更新它,别的不要改了 to smlabc: 如果如你所说我就需要重新SaveToStream一遍了 是这样吗? to 新世纪:我主要是用流来SaveToStream 转存一个成自己格式的文件 如 *.kk,*.ff之类的文件Procedure TClassZip.WriteHeader(Var HeaderStream:TMemoryStream; var EducationalLevel:string; // (长度为1) var SaleSoftID:string; // (长度为12) var HYVersion:string; // (长度为1) var CompressDate:string; // (长度为10) var CompressPathLength:integer; //压缩文件路径的长度() var compressPathstr:string //压缩文件路径 () );begin HeaderStream.Position :=0; if Length(EducationalLevel) > 0 then HeaderStream.WriteBuffer(EducationalLevel[1],Length(EducationalLevel)); HeaderStream.Position :=Length(EducationalLevel); if Length(SaleSoftID) > 0 then HeaderStream.WriteBuffer(SaleSoftID[1],Length(SaleSoftID)); HeaderStream.Position :=Length(EducationalLevel)+Length(SaleSoftID); if Length(HYVersion) > 0 then HeaderStream.WriteBuffer(HYVersion[1],1); HeaderStream.Position :=Length(EducationalLevel)+Length(SaleSoftID) +Length(HYVersion); if Length(CompressDate) > 0 then HeaderStream.WriteBuffer(CompressDate[1],10); ......end;