検索結果を別の関数に渡してファイルを取得する方法
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