Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
//            InfoDict dataObj = new InfoDict();

//            dataObj.ReadCSV();

//            dataObj.Save("data.bin");

            InfoDict rehydrated = InfoDict.Load("data.bin");

            Console.WriteLine("Finished!");
        }
Ejemplo n.º 2
0
        public static InfoDict Load(string sFileName)
        {
            FileInfo fi         = null;
            InfoDict rehydrated = null;

            fi = new FileInfo(sFileName);
            if (fi.Exists)
            {
                using (FileStream oStream = new FileStream(sFileName, FileMode.Open, FileAccess.Read))
                {
                    BinaryFormatter bf = new BinaryFormatter();
                    oStream.Position = 0;
                    rehydrated       = (InfoDict)bf.Deserialize(oStream);
                }
            }

            return(rehydrated);
        }