Пример #1
0
        private static void ExportKey(string keyXml, string keyName)
        {
            Console.Clear();
            ConsoleEx.TitleBar(0, "Export Key:" + keyName, ConsoleColor.Yellow, ConsoleColor.DarkBlue);

            ConsoleEx.TitleBar(0, "Export " + keyName, ConsoleColor.Yellow, ConsoleColor.DarkBlue);
            var tmpFile = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), keyName + ".txt");

            File.WriteAllText(tmpFile, keyXml);
            int exitCode = -1;
            var rr       = ExecuteProgram.ExecProgram("notepad.exe", string.Format(@"""{0}""", tmpFile), true, ref exitCode, true, false);

            BinSerializer.OverwriteFile(tmpFile);
            File.Delete(tmpFile);

            ConsoleEx.WriteLine(0, 2, string.Format("The {0} file, has been overwritten & deleted from the disk", keyName), ConsoleColor.Cyan);
            Pause();
        }
Пример #2
0
 public static List <byte> MakeBufferMultilpleOf(List <byte> buffer, int pageSize)
 {
     return(BinSerializer.MakeBufferUpTo(buffer, ((buffer.Count / pageSize) + 1) * pageSize));
 }