ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
fEncrypt (Example)
WINDEVWEBDEV - Server codeReports and QueriesJavaAjax Encrypting a file
The following code is used to encrypt a file. The password is entered in an edit control (EDT_Password). Priority is given to the encryption security (cryptSecure constant). The file may contain non-printable characters (False boolean).
// Declare the variables
FileToEncrypt is string
EncryptedFile is string
ResEncrypt is boolean
 
// Select the file to encrypt
FileToEncrypt = "C:\MyDirectories\File.txt"
 
// Select the encrypted file
EncryptedFile = "C:\MyDirectories\EncryptedFile.txt"
 
// Encrypt the file
ResEncrypt = fEncrypt(FileToEncrypt, EncryptedFile, EDT_Password, cryptSecure, False)
// Display an error message if the encryption failed
IF ResEncrypt = False THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The file was encrypted")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2023

Send a report | Local help