Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用WinSCP.NET程序集读取特定目录中的xml文件_C#_.net_Xml - Fatal编程技术网

C# 如何使用WinSCP.NET程序集读取特定目录中的xml文件

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++)

我需要使用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 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