Esempio n. 1
0
 public LoginCtrl()
 {
     if (!OpenFile())
     {
         _Data = new LoginStorage();
     }
 }
Esempio n. 2
0
        //Read from file and deserialize
        //load file
        private bool OpenFile()
        {
            LoginStorage temp;

            if (File.Exists(filename))
            {
                Stream          stream     = File.Open(filename, FileMode.Open);
                BinaryFormatter bformatter = new BinaryFormatter();

                temp = (LoginStorage)bformatter.Deserialize(stream);
                stream.Close();
                _Data = temp;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        //Read from file and deserialize
        //load file
        private bool OpenFile()
        {
            LoginStorage temp;
            if (File.Exists(filename))
            {
                Stream stream = File.Open(filename, FileMode.Open);
                BinaryFormatter bformatter = new BinaryFormatter();

                temp = (LoginStorage)bformatter.Deserialize(stream);
                stream.Close();
                _Data = temp;
                return true;
            }
            else return false;
        }
Esempio n. 4
0
 public LoginCtrl()
 {
     if(!OpenFile())
         _Data = new LoginStorage();
 }