File.Delete failing when Image.FromFile was called prior it, despite making copy of loaded image and destroying original one

前端 未结 5 1023
忘了有多久
忘了有多久 2020-11-30 10:56

UPDATED

I used below solutions (loading Image from stream), but get new problem. img object is absolutely correct Image class instance with all fiel

5条回答
  •  萌比男神i
    2020-11-30 11:11

    as share other way

    try
    {
    var img = Image.FromFile(s);
    var bmp = new Bitmap(img);
    img.Dispose();
    File.Delete(s);
    }
    catch { }
    

提交回复
热议问题