using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; namespace ALL_RFID_PROJECTS_1._0._2 { static class PROGRAM { static void Main() { Bitmap b = new Bitmap(@"D:\01.jpg"); System.IO.File.Delete(@"D:\01.jpg"); } } }
Bitmap b = new Bitmap(@"D:\01.jpg"); b.Dispose(); // now the bitmap is released System.IO.File.Delete(@"D:\01.jpg");
Bitmap b = new Bitmap(@"D:\01.jpg");
Bitmap temp = new Bitmap(@"D:\01.jpg"); Bitmap b = (Bitmap)temp.Clone(); temp.Dispose(); // now temp is released System.IO.File.Delete(@"D:\01.jpg"); // you may safely use b from now on and forget about temp...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)