我有以下代码:
Bitmap image = new Bitmap(filePath);
...
image.Save(someOtherPath);
image.Dispose();
File.Delete(filePath);
File.Move(someOtherPath, filePath);
File.Delete 行引发以下错误:
The process cannot access the file '...' because it is being used by another process.
如何让 C# 释放它对文件的锁定?