System.ComponentModel.Win32Exception: The operation completed successfully

前端 未结 8 1462
無奈伤痛
無奈伤痛 2020-12-04 22:20

I am getting this exception sometimes while running my Windows Forms app for a long time:

System.ComponentModel.Win32Exception: The operation completed succe         


        
8条回答
  •  伪装坚强ぢ
    2020-12-04 22:51

    Its caused in extreme cases by not disposing images. You should make use of IDisposable when loading bitmaps to overcome this;

    using(Bitmap b = Bitmap.FromFile("myfile.jpg"))
    {
       //Do whatever
    }
    

提交回复
热议问题