I am reading data from an AD/OU: hierarchical format and writing an XML file using stream writer:
if (File.Exists(fname))
File.Delete(fname);
StreamWriter sr = File.CreateText(fname);
sr.AutoFlush=true;
< ... read data
tmp1= data;
sr.WriteLine ("{0}",tmp1);
sr.Flush();
...>
sr.close()
On debug the file dumped is not in the same order as read: Eg:
reads a v d v
writes a n d f
???
What is wrong with the code. I am debugging and discovered that value of tmp1 that changes in the loop is not in the
same order as in the file.