The process cannot access the file because it is being used by another process - using static class

后端 未结 1 1957
伪装坚强ぢ
伪装坚强ぢ 2021-01-26 14:50

I get the error \"The process cannot access the file because it is being used by another process\" when I attempt to delete the files I just uploaded (this is at least a few sec

相关标签:
1条回答
  • 2021-01-26 15:32

    In your MakeThumbnail methods, make sure you're calling Dispose() on the Image types. That or use the using syntax:

    using (Image img = Image.FromFile(ImgIn))
    {
        // Your code
    }
    
    0 讨论(0)
提交回复
热议问题