Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stream writer question

Status
Not open for further replies.

raghu3

Programmer
Dec 19, 2005
96
US

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top