Шифрование файлов при помощи NTFS функций
Falk0ner, вс, 06/07/2008 - 15:34.
{....}
{
This tip works with Windows 2000 (NTFS 5) and later
These 2 functions are defined in windows.pas, but they're defined wrong. In this
case our own definition.
}
function EncryptFile(lpFilename: PChar): BOOL; stdcall;
external advapi32 name 'EncryptFileA';
function DecryptFile(lpFilename: PChar; dwReserved: DWORD): BOOL; stdcall;
external advapi32 name 'DecryptFileA';
{....}
procedure TForm1.Button1Click(Sender: TObject);
begin
if not EncryptFile('c:\temp') then
ShowMessage('Cant encrypt directory.');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if not DecryptFile('c:\temp', 0) then
ShowMessage('Cant decrypt directory.');
end;
{
This tip works with Windows 2000 (NTFS 5) and later
These 2 functions are defined in windows.pas, but they're defined wrong. In this
case our own definition.
}
function EncryptFile(lpFilename: PChar): BOOL; stdcall;
external advapi32 name 'EncryptFileA';
function DecryptFile(lpFilename: PChar; dwReserved: DWORD): BOOL; stdcall;
external advapi32 name 'DecryptFileA';
{....}
procedure TForm1.Button1Click(Sender: TObject);
begin
if not EncryptFile('c:\temp') then
ShowMessage('Cant encrypt directory.');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if not DecryptFile('c:\temp', 0) then
ShowMessage('Cant decrypt directory.');
end;
Отправить комментарий