Just thought of a way to encrypt files and decrypt them with only two lines of code:
Encrypt:
This encrypts the file: "\text.txt" >>> "\text.enc"Code:My.Computer.FileSystem.RenameFile(my.computer.filesystem.specialdirectories.mydocuments & "\text.txt", "text.enc")
You can have any extension you want as well. Just change the .enc extension.
Decrypt:
My.Computer.FileSystem.RenameFile(my.computer.filesystem.specialdirectories.mydocuments & "\text.enc", "text.txt")[/CODE]
This decrypts the file: "\text.enc" >>> "\text.txt"
If you wanna try it then try this code. It allows you to see the encryption.
1. Create "text.enc" file in your documents folder using notepad (or download from attachment).Code:My.Computer.FileSystem.RenameFile(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\text.enc", "text.txt") msgbox"Decrypted" My.Computer.FileSystem.RenameFile(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\text.txt", "text.enc") msgbox"Encrypted"
2. When the first messagebox comes up go to your documents folder and you will see the file "text.txt"
3. Then when the 2nd messagebox comes up look in your documents again and you will see a "text.enc" file.
Hope It Helps Someone
-----
knxrb





Reply With Quote