Net Encryption Library
EncodingMethod Property
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : EncodingMethod Property
Set the encoding method used for converting unicode strings into bytes. The default is UTF8
Syntax
'Declaration
 
Public Property EncodingMethod As System.Text.Encoding
'Usage
 
Dim instance As Encryption
Dim value As System.Text.Encoding
 
instance.EncodingMethod = value
 
value = instance.EncodingMethod
public System.Text.Encoding EncodingMethod {get; set;}
public read-write property EncodingMethod: System.Text.Encoding; 
public function get,set EncodingMethod : System.Text.Encoding
public: __property System.Text.Encoding* get_EncodingMethod();
public: __property void set_EncodingMethod( 
   System.Text.Encoding* value
);
public:
property System.Text.Encoding^ EncodingMethod {
   System.Text.Encoding^ get();
   void set (    System.Text.Encoding^ value);
}
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
//Change the encoding method to ASCII
encryption.EncodingMethod = Encoding.ASCII;
 
const string password = "MyPassword";
const string unencryptedString = "This is the input";
Console.WriteLine("The unencrypted string: {0}", unencryptedString);
 
string encryptedString = encryption.EncryptString(EncryptionProvider.Rijndael, password, unencryptedString);
Console.WriteLine("The encrypted string: {0}", encryptedString);
 
string decryptedString = encryption.DecryptString(EncryptionProvider.Rijndael, password, encryptedString);
Console.WriteLine("The deencrypted string: {0}", decryptedString);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
'Change the encoding method to ASCII
encryption.EncodingMethod = Encoding.ASCII
 
Const password As String = "MyPassword"
Const unencryptedString As String = "This is the input"
Console.WriteLine("The unencrypted string: {0}", unencryptedString)
 
Dim encryptedString As String = encryption.EncryptString(EncryptionProvider.Rijndael, password, unencryptedString)
Console.WriteLine("The encrypted string: {0}", encryptedString)
 
Dim decryptedString As String = encryption.DecryptString(EncryptionProvider.Rijndael, password, encryptedString)
Console.WriteLine("The deencrypted string: {0}", decryptedString)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Encryption Class
Encryption Members