how to get data from saved file

2010-07-20
2013-04-11
  • Wilson Chan
    Wilson Chan
    2010-07-20

    the following code works for new file, but if ReOpen, the data will be accessible.

                string storagePath = @"c:\temp\foo";
                string storageTreeFile = storagePath + "tree.dat";
                string storageBlockFile = storagePath + "block.dat";
                hBplusTree storage;
                if (File.Exists(storagePath + "tree.dat"))
                    storage = hBplusTree.ReOpen(storageTreeFile, storageBlockFile);
                else
                    storage = hBplusTree.Initialize(storageTreeFile, storageBlockFile, 6);
                storage = "hello, world";
                Console.WriteLine(storage);
                storage.Shutdown();