如何将搜索结果传递给另一个函数来抓取文件
static void Main(string[] args)
{
XmlDocument xml = new XmlDocument();
xml.Load(@"C:\MR.xml");
XmlNodeList stations = xml.SelectNodes("//FileDump/Message/Attachment");
var Message_ID = xml.SelectSingleNode("//FileDump/Message/MsgID").InnerXml;
Console.WriteLine("Message ID is :{0}", Message_ID);
foreach (XmlNode station in stations)
{
var File_Name = station.SelectSingleNode("FileName").InnerXml;
var File_ID = station.SelectSingleNode("FileID").InnerXml;
}
}
以下是搜索结果:
Message ID is :4830B9AA00000F7900650001
The File Name :1088656850147001.HTM
The File ID is :4830B9AB0000092207F42618.HTM
The File Name :fxdailyupdate_080519.pdf
The File ID is :4830B9AC000007F907E42798.pdf
The File Name :DR080516R.pdf
The File ID is :4830B9AD0000092207F42620.pdf