如何通过参数传递一个我Iterator
的变量?
protected void LeXMLNode(FileUpload fupArquivo)
{
XmlDocument doc = new XmlDocument();
doc.Load(fupArquivo.FileContent);
XmlNodeList ndo = doc.SelectNodes("*");
var it = ndo.GetEnumerator();
using (it as IDisposable)
while (it.MoveNext())
{
//// Pass the variable it as parameter
}
}
答案 0 :(得分:1)
使用.Current
属性:
using (var it = ndo.GetEnumerator())
while (it.MoveNext())
{
//// Pass the variable it as parameter
SomeFunction(it.Current);
}