|
'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
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
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
|
|