namespace DisposeTry { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Image mimg = new Bitmap("repository.png")) image1.Image = mimg; } } }
namespace DisposeTry { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { using (Image mimg = new Bitmap("repository.png")) image1.Image = mimg; // Obvious error } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)