Beispiel #1
0
        public Form1()
        {
            InitializeComponent();
            _joe = new Guy();
            _bob = new Guy();
            _joe.Name = "Joe";
            _bob.Name = "Bob";
            _joe.Cash = 50;
            _bob.Cash = 100;
            _bank = 100;
            UpdateForm();

        }
Beispiel #2
0
		private void loadJoeButton_Click(object sender, EventArgs e)
		{
			using (Stream input = File.OpenRead("Guy_file.dat"))
			{
				BinaryFormatter formatter = new BinaryFormatter();
				_joe = (Guy)formatter.Deserialize(input);
			}
			UpdateForm();
		}