Item 15:Utilize using and try/finally for Resource Cleanup
2005-08-12 19:59
459 查看
Types that use unmanaged system resource should be explicity released using the dispose() method of the IDisposable interface.
这个Item只是建议多使用using和try...catch块。值得注意的是using语句本身也是将代码生成为try...catch块。他们产生的IL是一样的。还有就是using 语句中的变量要是支持IDispose接口的,否则会报错!!不要重递使用using
这个Item只是建议多使用using和try...catch块。值得注意的是using语句本身也是将代码生成为try...catch块。他们产生的IL是一样的。还有就是using 语句中的变量要是支持IDispose接口的,否则会报错!!不要重递使用using
相关文章推荐
- Item 15: Utilize using and try/finally for Resource Cleanup(Effective C#)
- Effective C# Item 15: Utilize using and try/finally for Resource Cleanup
- Effective C#之15:Utilize using and Try/finally for Resource Cleanup
- Utilize using and try/finally for Resource Cleanup
- 【转】Effective C# Item 15: Utilize using and try-finally
- Effective C# Item15:利用using和try/finally语句来清理资源
- Effective C# Item15:利用using和try/finally语句来清理资源
- 《Effective C#》Item 15:利用using和try-finally来释放资源
- 《Effective C#》Item 15:利用using和try-finally来释放资源
- Effective C# 原则15:使用using和try/finally来做资源清理
- 15.使用using和try/finally来做资源清理
- EffectiveC#15--使用using和try/finally来做资源清理
- Effective C# 原则15:使用using和try/finally来做资源清理(译)
- Effective C# 原则15:使用using和try/finally来做资源清理
- Effective Objective-C 2.0: Item 31: Release References and Clean Up Observation State Only in deallo
- Device Tree Cleanup and Reset (Controller Renumbering)
- [linux]Cannot retrieve metalink for repository: fedora. Please verify its path and try again
- TN035: Using Multiple Resource Files and Header Files with Visual C++
- 【Data Algorithms_Recipes for Scaling up with Hadoop and Spark】Chapter 7 Market Basket Analysis
- Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Lig