Ninja Database Lite
EncryptionPassword Property
Example 



KellermanSoftware.NinjaDatabaseLite Namespace > NinjaDbConfig Class : EncryptionPassword Property
The password to use when encrypting objects.
Syntax
Public Property EncryptionPassword As String
Dim instance As NinjaDbConfig
Dim value As String
 
instance.EncryptionPassword = value
 
value = instance.EncryptionPassword
public string EncryptionPassword {get; set;}
public:
property String^ EncryptionPassword {
   String^ get();
   void set (    String^ value);
}
Example
List<Person> personList = new List<Person>();
            for (int i = 1; i <= 1000; i++)
            {
                Person person = new Person();
                person.Name = "Person" + i;
                person.PersonId = i;
                personList.Add(person);
            }
             
            NinjaDb ninja = new NinjaDb(); //Trial Mode
            // NinjaDb ninja = new NinjaDb("My User Name","My License Key"); //Licensed mode
             
            //Turn encryption on
            ninja.EncryptionPassword = "top secret";
            ninja.Format = EncodingFormat.AesEncrypted;
             
            //Save it
            ninja.Save(personList);
Dim personList As New List(Of Person)()
            For i As Integer = 1 To 1000
            	Dim person As New Person()
            	person.Name = "Person" & i
                person.PersonId = i
                personList.Add(person)
            Next i
             
            Dim ninja As New NinjaDb() 'Trial mode
            ' Dim ninja as New NinjaDb("My User Name", "My License Key") 'Licensed mode
             
            'Turn encryption on
            ninja.EncryptionPassword = "top secret"
            ninja.Format = EncodingFormat.AesEncrypted
             
            'Save it
            ninja.Save(personList)
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

NinjaDbConfig Class
NinjaDbConfig Members