can not find part of the path at C:\pg\XMLPull\xmlFiles2015\4cenUS.xml DirectoryInfo di = Directory.CreateDirectory(@"C:\pg\XMLPull\xmlFiles2015\"); var getFiles = Directory.GetFiles(@"\\Company\file\","*xml",SearchOption.AllDirectories).ToList(); DirectoryInfo di = Directory.CreateDirectory(;C:\pg\XMLPull\xmlFiles2015\); getFiles.ForEach(file => { var fileContents = File.ReadAllText(file); if (!fileContents.Contains(Diagnostics<systemname>)) return; else File.WriteAllText(C:\pg\XMLPull\xmlFiles52015\ + Path.GetFileName(file), fileContents) </pre>
else File.WriteAllText(@"C:\pg\XMLPull\xmlFiles52015\" + Path.GetFileName(file), fileContents);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)