How does the “Using” statement translate from C# to VB?

前端 未结 5 957
星月不相逢
星月不相逢 2020-12-03 09:20

For example:

BitmapImage bitmap = new BitmapImage();

byte[] buffer = GetHugeByteArray(); // from some external source
using (MemoryStream stream = new Memor         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 10:18

    The key point is that the class being "used" must implement the IDisposable interface.

提交回复
热议问题