Kryptování a dekryptování na Windows XP

Postup:
Private Declare Function EncryptFile Lib "ADVAPI32" Alias _ 
"EncryptFileA" (ByVal lpFileName As String) As Boolean 

Private Declare Function DecryptFile Lib "ADVAPI32" Alias _ 
"DecryptFileA" (ByVal lpFileName As String, ByVal dwReserved As Long) As Boolean 

Public Function Encrypt(ByVal strFileName As String) As Boolean 

   Encrypt = (EncryptFile(strFileName) = True) 

End Function 

Public Function Decrypt(ByVal strFileName As String) 

   Decrypt = (DecryptFile(strFileName, 0) = True) 

End Function

Použití:
Private Sub Command1_Click()

    If Encrypt("c:\temp\MyFile.txt") Then
        MsgBox "Maká :)"
    Else
        MsgBox "Nemaká :("
    End If

End Sub

Zpět

Autor: The Bozena

iReklama.cz - nový reklamní systém
iReklama.cz - nový reklamní systém