c# using是try-finally语法糖
//using var list = new List<Object>(); using (var items = list.GetEnumerator()) { } //try-finally(这也是foreach内部实现) var items = list.GetEnumerator(); try { while (items.MoveNext()) { var current = items.Current; } } finally { items.Dispose(); }