(Gast)
n/a Beiträge
|
Re: 35 Mal überschreiben
29. Jul 2004, 17:38
Was muss ich jetzt an deinem Code ändern, wenn ich es 35 mal
überschreiben will?
Etwa so???
Delphi-Quellcode:
procedure EraseFile(Filename: string);
const
Buffer = 1024;
Counttowrite = 34;
FillBuffer: array[0..5] of Integer = ($00, $FF, $00, $F0, $0F, $00)
var
arr: array[1..Buffer] of byte;
f: file;
i, j, n: integer;
begin
AssignFile(f, FileName);
Reset(f, 1);
n := FileSize(f);
for j := 35 to Counttowrite do //<-- Hier
begin
for i := 1 to n div Buffer do
begin
BlockWrite(f, FillBuffer[j], Buffer);
end;
end;
CloseFile(f);
RenameFile(Filename, ExtractFilepath(Filename)+'$000000.tmp');
DeleteFile(ExtractFilepath(Filename)+'$000000.tmp');
end;
|
|
Zitat
|