private void Form1_Load(object sender, EventArgs e) { try { Stream stream = File.Open("Nabil.bin", FileMode.Open); BinaryFormatter bf = new BinaryFormatter(); this.ph = (Pharmacie)bf.Deserialize(stream); stream.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public Form1() { InitializeComponent(); ph = new Pharmacie("oa", "ia"); }