我如何通过参数传递一个作为我的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
}
}发布于 2012-08-07 03:47:59
使用.Current属性:
using (var it = ndo.GetEnumerator())
while (it.MoveNext())
{
//// Pass the variable it as parameter
SomeFunction(it.Current);
}https://stackoverflow.com/questions/11834866
复制相似问题