Thursday, August 1, 2013

Close a file effectly


Did you try adding your query to a list and write only once ?

List<string> fileContent = new List<string>();
foreach (var y in query)
{
fileContent.Add(y.Path + "_" + y.Name);
}
File.WriteAllLines(outputFileName, fileContent.ToArray())


No comments:

Post a Comment