Disposables, Using & Try/Catch Blocks

后端 未结 6 1398
一向
一向 2020-12-19 05:56

Having a mental block today, need a hand verifying my logic isn\'t fubar\'ed.

Traditionally I would do file i/o similar to this:

FileStream fs = null         


        
6条回答
  •  旧巷少年郎
    2020-12-19 06:22

    This will work - internally the using statement compiles the same way as a try-finally block

提交回复
热议问题