小编Tra*_*y13的帖子

哪里最后是必要的?

我知道如何使用try-catch-finally.但是我没有得到使用的进展,finally因为我总是可以在try-catch块之后放置代码.有没有明确的例子?

c# exception finally

10
推荐指数
1
解决办法
564
查看次数

我正确使用"使用"声明吗?

我想知道我的使用using是否正确.在using统计中,我决定是否应该在游戏中使用图像.

Image imageOfEnemy;
using(imageOfEnemy=Bitmap.FromFile(path))
{
   // some stuff with the imageOfEnemy variable

}
Run Code Online (Sandbox Code Playgroud)

根据我的理解,我现在不需要打电话Dispose.

.net c# using-statement

2
推荐指数
1
解决办法
1436
查看次数

标签 统计

c# ×2

.net ×1

exception ×1

finally ×1

using-statement ×1