C# 如何使用WinSCP.NET程序集读取特定目录中的xml文件
我需要使用WinSCP.NET程序集在目录中循环查找具有特定条件的xml文件,我将感谢您的帮助 我使用以下逻辑来迭代系统中解决方案的ErrorMessages目录中的xml文件(提供本地路径),希望使用WinSCP.NET程序集使用相同的逻辑:C# 如何使用WinSCP.NET程序集读取特定目录中的xml文件,c#,.net,xml,C#,.net,Xml,我需要使用WinSCP.NET程序集在目录中循环查找具有特定条件的xml文件,我将感谢您的帮助 我使用以下逻辑来迭代系统中解决方案的ErrorMessages目录中的xml文件(提供本地路径),希望使用WinSCP.NET程序集使用相同的逻辑: var files = Directory.EnumerateFiles("D:/GIS/Production/ErrorMessages"); for (int i = 0; i < files.ToList().Count - 1; i++)
var files = Directory.EnumerateFiles("D:/GIS/Production/ErrorMessages");
for (int i = 0; i < files.ToList().Count - 1; i++)
{
var fileName = files.ToList()[i].Replace(@"\", "/");
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
XmlNodeList customerList = doc.DocumentElement.SelectNodes("Document/Body");
XmlNodeList nodeList = doc.DocumentElement.SelectNodes("InvoiceResponse/Subscribers");
for (int j = 0, k = 0; j < customerList.Count; j++)
{
tw.WriteLine(customerList[j].InnerXml + "," + nodeList[k].InnerXml);
}
}
var files=Directory.enumerated文件(“D:/GIS/Production/ErrorMessages”);
对于(int i=0;i
请参见以下内容linkhttps://winscp.net/eng/docs/guide_interpreting_xml_logPlease 见下文linkhttps://winscp.net/eng/docs/guide_interpreting_xml_log