Hi everybody! :wave:
I'm after a fast, short and easy code to encrypt/decrypt files.
The important thing is that the code works fast and works with all files, I don't care if it's not advanced cryptation.
I'll rate everyone who helps me! :D
//Alex
Printable View
Hi everybody! :wave:
I'm after a fast, short and easy code to encrypt/decrypt files.
The important thing is that the code works fast and works with all files, I don't care if it's not advanced cryptation.
I'll rate everyone who helps me! :D
//Alex
From AllAPI.net:
VB Code:
'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: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] 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
gavio: on my computer, nothing happends when I run that code..
Did you try the examples I linked to?
yes, just did. works great! :D
tnx shirazamod! :D
My pleasure :thumb: