PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Encrypting a file
  • Encrypting a file
fEncrypt (Example)
Encrypting a file
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)Ajax 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
Encrypting a file
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment