예제 #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();

        }
예제 #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();
		}