Make your own free website on

[an error occurred while processing this directive]
'Note: Encryptfile only works on NTFS 5
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
Const mFile = "c:\test.txt"
Private Sub Form_Load()
    'KPD-Team 2000
    Encrypt mFile
End Sub
Sub Encrypt(sFile As String)
    If EncryptFile(mFile) Then
        MsgBox "The file's succesfully encrypted. Log in as another user and try to access this file."
    End If
End Sub
Sub Decrypt(sFile As String)
    If DecryptFile(mFile, 0) = True Then
        MsgBox "The file's succesfully decrypted."
    End If
End Sub

Copyright © 1998-2000, The KPD-Team.
Send mail to with comments about this web site.
This site is located at