水
水平线
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
FileStream: TFileStream;
i: integer;
filesize: integer;
bufferARRchar;
begin
screen.Cursor := crHourGlass;
filesize := 3;
//这里是DST文件,或是JPG什么的。。
FileStream:= TFileStream.Create('d:/RP533.DST',fmOpenRead);
MemoryStream := TmemoryStream.Create;
try
MemoryStream.LoadFromStream(FileStream);
finally
FileStream.Free;
end;
TempMemory := TmemoryStream.create;
i:=0;
try
MemoryStream.Position := 512;
//MemoryStream.SaveToFile('aaa.ini');
while MemoryStream.Position < MemoryStream.Size -1 do
begin
TempMemory.Position := 0 ;
TempMemory.Size := 0;
if MemoryStream.Size - MemoryStream.Position < FileSize then
FileSize := MemoryStream.Size - MemoryStream.Position;
TempMemory.CopyFrom(MemoryStream,FileSize);
TempMemory.Read(BufferARR,TempMemory.Size);
//这里按照我的理解BufferARR应该有三个byte吧!~现在我想把它以二进制的
//形式取出来,然后按位进行处理!小菜搞了二天一个晚上,555
//大侠帮帮忙,要不101又完了!!!!!
ReadMemory();
end;
finally
MemoryStream.Free;
TempMemory.Free;
end;
screen.Cursor := crDefault;
end;
var
FileStream: TFileStream;
i: integer;
filesize: integer;
bufferARRchar;
begin
screen.Cursor := crHourGlass;
filesize := 3;
//这里是DST文件,或是JPG什么的。。
FileStream:= TFileStream.Create('d:/RP533.DST',fmOpenRead);
MemoryStream := TmemoryStream.Create;
try
MemoryStream.LoadFromStream(FileStream);
finally
FileStream.Free;
end;
TempMemory := TmemoryStream.create;
i:=0;
try
MemoryStream.Position := 512;
//MemoryStream.SaveToFile('aaa.ini');
while MemoryStream.Position < MemoryStream.Size -1 do
begin
TempMemory.Position := 0 ;
TempMemory.Size := 0;
if MemoryStream.Size - MemoryStream.Position < FileSize then
FileSize := MemoryStream.Size - MemoryStream.Position;
TempMemory.CopyFrom(MemoryStream,FileSize);
TempMemory.Read(BufferARR,TempMemory.Size);
//这里按照我的理解BufferARR应该有三个byte吧!~现在我想把它以二进制的
//形式取出来,然后按位进行处理!小菜搞了二天一个晚上,555
//大侠帮帮忙,要不101又完了!!!!!
ReadMemory();
end;
finally
MemoryStream.Free;
TempMemory.Free;
end;
screen.Cursor := crDefault;
end;