Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  90

•  TDictionary Custom Sort  3 291

•  Fast Watermark Sources  3 042

•  3D Designer  4 796

•  Sik Screen Capture  3 292

•  Patch Maker  3 511

•  Айболит (remote control)  3 607

•  ListBox Drag & Drop  2 968

•  Доска для игры Реверси  81 407

•  Графические эффекты  3 896

•  Рисование по маске  3 206

•  Перетаскивание изображений  2 591

•  Canvas Drawing  2 710

•  Рисование Луны  2 539

•  Поворот изображения  2 144

•  Рисование стержней  2 149

•  Paint on Shape  1 556

•  Генератор кроссвордов  2 211

•  Головоломка Paletto  1 754

•  Теорема Монжа об окружностях  2 192

•  Пазл Numbrix  1 675

•  Заборы и коммивояжеры  2 045

•  Игра HIP  1 270

•  Игра Go (Го)  1 219

•  Симулятор лифта  1 462

•  Программа укладки плитки  1 204

•  Генератор лабиринта  1 534

•  Проверка числового ввода  1 339

•  HEX View  1 481

•  Физический маятник  1 346

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Удалить файл навсегда



Оформил: DeeCo

{ 
  If you want to get rid of a file normally you just delete it. 
  But someone else can undelete it if the file hasn't been wiped correctly. 
  For security purposes, to insure that certain files are permanently 
  gone, the WipeFile procedure writes over the data in the file with 
  random characters and then erases it. 

  Wenn man eine Datei nicht mehr braucht, loscht man sie einfach. 
  Aber jemand anders kann die Datei wieder herstellen, wenn sie 
  nicht "richtig" geloscht wurde. 
  Aus Sicherheitsgrunden, um sicherzustellen, dass eine Datei permanent 
  geloscht wird, uberschreibt die WipeFile Prozedur eine Datei mit 
  Zufalls-Zeichen und loscht sie anschliessend. 
}

 procedure WipeFile(FileName: string);
 var
   buffer: array [0..4095] of Byte;
   max, n: LongInt;
   i: Integer;
   fs: TFileStream;

   procedure RandomizeBuffer;
   var
     i: Integer;
   begin
     for i := Low(buffer) to High(buffer) do
       buffer[i] := Random(256);
   end;
 begin
   fs := TFilestream.Create(FileName, fmOpenReadWrite or fmShareExclusive);
   try
     for i := 1 to 3 do
     begin
       RandomizeBuffer;
       max := fs.Size;
       fs.Position := 0;
       while max > 0 do
       begin
         if max > SizeOf(buffer) then
           n := SizeOf(buffer)
         else
           n := max;
         fs.Write(Buffer, n);
         max := max - n;
       end;
       FlushFileBuffers(fs.Handle);
     end;
   finally
     fs.Free;
   end;
   Deletefile(FileName);
 end;




Похожие по теме исходники

Чтение PSD файлов

Шифратор файлов

Разбиение файла на части

Поиск файлов

 

FileMan (менеджер файлов)

Поиск открытых файлов

Текст внутри файла




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте