PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Encrypting a file
  • Encrypting a file
fEncrypt (Example)
Encrypting a file
WINDEVWEBDEV - Server codeReports and QueriesJavaAjaxUser code (UMC) 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
Windows Mobile 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 = "\My files\FileA.txt"
EncryptedFile is string = "\My files\FileB.txt"
ResEncrypt is boolean

// 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