Registriert seit: 11. Aug 2003
Ort: Dresden OT Cossebaude
71 Beiträge
Delphi 2005 Personal
|
Re: 35 Mal überschreiben
29. Jul 2004, 17:18
Bitte:
Delphi-Quellcode:
procedure EraseFile(Filename: string);
const
Buffer = 1024;
Counttowrite = 34;
FillBuffer: array[0..5] of Integer = ($00, $FF, $00, $F0, $0F, $00); //<-- Hier
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 := 0 to Counttowrite do
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;
Die Konstante "Counttowrite" gibt an wieviel mal du das überschreiben willst.
[ OT] war wohl etwas zu langsam [/ OT]
Robert Codito, ergo sum.
>>I code, therefore I am<<
|
|
Zitat
|