Einzelnen Beitrag anzeigen

HW764
(Gast)

n/a Beiträge
 
#28

Re: SchredderProg (mit source) gesucht!

  Alt 3. Jul 2004, 15:21
Delphi-Quellcode:
procedure TForm1.SpeedButton1Click(Sender: TObject);
const Buffer = 1024;
var
  arr: array [1..Buffer] of byte;
  fi: file;
  i, n: integer;
begin
  if OpenDialog1.Execute then
  begin
    AssignFile(fi, OpenDialog1.FileName);
    Reset(fi, 1);
    n := FileSize(fi);
FillChar(arr, SizeOf(arr), #0);
    FillChar(arr, SizeOf(arr), $00);
        FillChar(arr, SizeOf(arr), $FF);
            FillChar(arr, SizeOf(arr), $00);
                FillChar(arr, SizeOf(arr), $F0);
                    FillChar(arr, SizeOf(arr), $0F);
                        FillChar(arr, SizeOf(arr), $00);


    for i := 1 to n div Buffer do
    begin
      BlockWrite(fi, arr, n mod Buffer);
    end;
    CloseFile(fi);
    Erase(fi);
  end;
end;

Soooo??? *liebschau*
Und was passiert, wenn ichs so schreibe?

Delphi-Quellcode:
procedure TForm1.SpeedButton1Click(Sender: TObject);
const Buffer = 1024;
var
  arr: array [1..Buffer] of byte;
  fi: file;
  i, n: integer;
begin
  if OpenDialog1.Execute then
  begin
    AssignFile(fi, OpenDialog1.FileName);
    Reset(fi, 1);
    n := FileSize(fi);
FillChar(arr, SizeOf(arr), #0);
    FillChar(arr, SizeOf(arr), $00);
        FillChar(arr, SizeOf(arr), $FF);
            FillChar(arr, SizeOf(arr), $00);
                FillChar(arr, SizeOf(arr), $F0);
                    FillChar(arr, SizeOf(arr), $0F);
                        FillChar(arr, SizeOf(arr), $00);
FillChar(arr, SizeOf(arr), #0);
    FillChar(arr, SizeOf(arr), $00);
        FillChar(arr, SizeOf(arr), $FF);
            FillChar(arr, SizeOf(arr), $00);
                FillChar(arr, SizeOf(arr), $F0);
                    FillChar(arr, SizeOf(arr), $0F);
                        FillChar(arr, SizeOf(arr), $00);
FillChar(arr, SizeOf(arr), #0);
    FillChar(arr, SizeOf(arr), $00);
        FillChar(arr, SizeOf(arr), $FF);
            FillChar(arr, SizeOf(arr), $00);
                FillChar(arr, SizeOf(arr), $F0);
                    FillChar(arr, SizeOf(arr), $0F);
                        FillChar(arr, SizeOf(arr), $00);


    for i := 1 to n div Buffer do
    begin
      BlockWrite(fi, arr, n mod Buffer);
    end;
    CloseFile(fi);
    Erase(fi);
  end;
end;
Wirds dann noch mehrmal überschrieben?
  Mit Zitat antworten Zitat