Changeset 338 for branches/eraser6/Eraser/Program.cs
- Timestamp:
- 4/1/2008 1:23:39 PM (5 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Eraser/Program.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/Program.cs
r332 r338 29 29 //Load the task list 30 30 RegistryKey key = Application.UserAppDataRegistry; 31 byte[] savedTaskList = (byte[])key.GetValue("TaskList", new byte[ ] { });31 byte[] savedTaskList = (byte[])key.GetValue("TaskList", new byte[0]); 32 32 using (MemoryStream stream = new MemoryStream(savedTaskList)) 33 33 { … … 97 97 S.Language = new CultureInfo(UILanguage); 98 98 99 //Load the plausible deniability files 100 byte[] plausibleDeniabilityFiles = (byte[]) 101 key.GetValue("PlausibleDeniabilityFiles", new byte[0]); 102 if (plausibleDeniabilityFiles.Length != 0) 103 using (MemoryStream stream = new MemoryStream(plausibleDeniabilityFiles)) 104 { 105 try 106 { 107 this.PlausibleDeniabilityFiles = (List<string>) 108 new BinaryFormatter().Deserialize(stream); 109 } 110 catch (Exception) 111 { 112 key.DeleteValue("PlausibleDeniabilityFiles"); 113 MessageBox.Show(S._("Could not load list of files used for plausible " + 114 "deniability.\n\nThe list of files have been lost."), 115 S._("Eraser"), MessageBoxButtons.OK, MessageBoxIcon.Error); 116 } 117 } 118 99 119 //Load the plugin settings. 100 byte[] pluginSettings = (byte[])key.GetValue("PluginSettings", new byte[ ] { });120 byte[] pluginSettings = (byte[])key.GetValue("PluginSettings", new byte[0]); 101 121 if (pluginSettings.Length != 0) 102 122 using (MemoryStream stream = new MemoryStream(pluginSettings)) … … 139 159 key.SetValue("PluginSettings", stream.ToArray(), RegistryValueKind.Binary); 140 160 } 161 162 using (MemoryStream stream = new MemoryStream()) 163 { 164 new BinaryFormatter().Serialize(stream, PlausibleDeniabilityFiles); 165 key.SetValue("PlausibleDeniabilityFiles", stream.ToArray(), RegistryValueKind.Binary); 166 } 141 167 } 142 168 }
Note: See TracChangeset
for help on using the changeset viewer.
