type NNMZDData=record CardNo:Integer; OwnerName :Array [0..11] of byte; PlateNo:Array [0..11] of byte ; ReaderNo:Integer; ReaderName:Array [0..23] of byte ; end; end; procedure TForm1.btn2Click(Sender: TObject); var p : nnmzd_Service; data:NNMZDData; test:TByteDynArray; OwnerName ,PlateNo, ReaderName:string; begin data.CardNo:=1; OwnerName:='张三111'; PlateNo:='粤A12345'; ReaderName:='一号岗亭入口'; Move(OwnerName[1],data.OwnerName,12); Move(PlateNo[1],data.PlateNo,12); Move(ReaderName[1],data.ReaderName,24); SetLength(test,sizeof(data)); Move(data,test[0],sizeof(data)); p := htpr1 As nnmzd_Service; p.UpBroke(test) end;