TDMSRequestBuffer=object
Head:TDMSHead;
Data:array[0..2047] of char;
DataSize:Integer;
procedure Init(Sys:TDMSSysType;Svr:TDMSSvrType);
procedure EncodeRequest;
function Size:integer;
end;
目的,保存Data
function SaveDataToFile(AFileName: string; AData: Pointer; ALen: Integer): Boolean;
var
stream: TMemoryStream;
begin
Result := False;
stream := TMemoryStream.Create;
try
try
stream.Write(AData^,ALen);
stream.SaveToFile(AFileName);
Result := True;
except
end;
finally
stream.Free;
end;
end;
调用方法
SaveDataToFile(‘E:\1.txt‘,@RB.Data[0],RB.DataSize);
时间: 2024-09-29 08:38:00