我知道如何使用try-catch-finally.但是我没有得到使用的进展,finally因为我总是可以在try-catch块之后放置代码.有没有明确的例子?
我想知道我的使用using是否正确.在using统计中,我决定是否应该在游戏中使用图像.
Image imageOfEnemy;
using(imageOfEnemy=Bitmap.FromFile(path))
{
// some stuff with the imageOfEnemy variable
}
Run Code Online (Sandbox Code Playgroud)
根据我的理解,我现在不需要打电话Dispose.