The Decrypt method decrypts a string that was encrypted with the Encrypt method or stored as an encrypted value in Setup.Settings.
Syntax
Decrypt(Text as String, Key as String) as String
Parameters
Text
The encrypted text to decrypt.
Key
The key that was used to encrypt the string.
Return Value
The decrypted string.
Example
Suppose your application needs a password to access a resource. You don't want to store the password in clear text, so you use the code in the Setup.Settings event to store it as an encrypted value in the Registry. Later, you need to decrypt the encrypted value so you can use it to access the resource.
The code shown in these examples would be part of a larger script.
Visual FoxPro
lcPassword = SQApplication.GetRegistryValue('dbpassword', '')
lcPassword = SQApplication.Decrypt(lcPassword, 'whatever')
* do something with the password here
VBScript
Password = Application.GetRegistryValue("dbpassword", "")
Password = SQApplication.Decrypt(Password, "whatever")
' do something with the password here
JavaScript
Password = Application.GetRegistryValue('dbpassword', '') ;
Password = SQApplication.Decrypt(Password, 'whatever') ;
' do something with the password here
C#
Password = SQApplication.GetRegistryValue("dbpassword", "");
Password = SQApplication.Decrypt(Password, "whatever");
' do something with the password here
VB.NET
Password = SQApplication.GetRegistryValue("dbpassword", "")
Password = SQApplication.Decrypt(Password, "whatever")
' do something with the password here
See also
Application Object | Encrypt | Setup.Settings© Stonefield Software Inc., 2024 • Updated: 06/06/16
Comment or report problem with topic