Ejemplo n.º 1
0
        public void TestLoadKdb1WithKeyfileByDirectCall()
        {
            ImporterV3 importer = new ImporterV3();

            try
            {
                FileStream dbStream      = new FileStream(TestDbDirectory + "withkeyfile_nopwd.kdb", FileMode.Open);
                FileStream keyfileStream = new FileStream(TestDbDirectory + "withkeyfile.key", FileMode.Open);

                /*
                 * for (int i = 0; i < 10; i++)
                 * {
                 *      int b = keyfileStream.ReadByte();
                 *      Kp2aLog.Log(i+": " + b);
                 * }
                 * keyfileStream.Close();
                 * Kp2aLog.Log("stream 2");
                 * var keyfileStream2 = new MemoryStream(new KcpKeyFile(TestDbDirectory + "withkeyfile.key").RawFileData.ReadData());
                 * for (int i = 0; i < 10; i++)
                 * {
                 *      int b = keyfileStream2.ReadByte();
                 *      Kp2aLog.Log(i + ": " + b);
                 * }*/
                importer.OpenDatabase(dbStream, "", keyfileStream);
            }
            catch (Exception e)
            {
                Kp2aLog.Log(e.ToString());
                Assert.Fail("exception occured: " + e);
            }
        }
Ejemplo n.º 2
0
        public void TestLoadKdb1WithKeyfileByDirectCall()
        {
            ImporterV3 importer = new ImporterV3();

            try
            {
                FileStream dbStream = new FileStream(TestDbDirectory+"withkeyfile_nopwd.kdb", FileMode.Open);
                FileStream keyfileStream = new FileStream(TestDbDirectory + "withkeyfile.key", FileMode.Open);
                /*
                for (int i = 0; i < 10; i++)
                {
                    int b = keyfileStream.ReadByte();
                    Kp2aLog.Log(i+": " + b);
                }
                keyfileStream.Close();
                Kp2aLog.Log("stream 2");
                var keyfileStream2 = new MemoryStream(new KcpKeyFile(TestDbDirectory + "withkeyfile.key").RawFileData.ReadData());
                for (int i = 0; i < 10; i++)
                {
                    int b = keyfileStream2.ReadByte();
                    Kp2aLog.Log(i + ": " + b);
                }*/
                importer.OpenDatabase(dbStream, "", keyfileStream);
            }
            catch (Exception e)
            {
                Kp2aLog.Log(e.ToString());
                Assert.Fail("exception occured: " + e);
            }
        }