F
Frank
Hi,
Let's say I have a file named myFile.xml
Within that file I have blocks of data which I'd like to add at different
times during the day.
e.g.
<LogEntry>
<Stuff> stuff here </Stuff>
<LogEntryDate>date time here</LogEntryDate>
</LogEntry>
....
<LogEntry>
<Stuff> stuff here </Stuff>
<LogEntryDate>date time here</LogEntryDate>
</LogEntry>
Now, I'd like to use XMLSerialization, but when appending I get the <xml...>
line which I don't want after the first entry.
<?xml version="1.0" encoding="utf-8"?>
Is there a way to use XMLSerializer so that when appending, this line is not
added?
Here is my current code, which creates the file if it doesn't exist,
otherwise appends the next chunk of xml.
XmlSerializer ser = new XmlSerializer(typeof(MyClass));
bool bAppend = true;
TextWriter writer = new StreamWriter(strUsageLogFileName, bAppend );
ser.Serialize(writer, this);
writer.Close();
Thanks for any tips,
Frank
Let's say I have a file named myFile.xml
Within that file I have blocks of data which I'd like to add at different
times during the day.
e.g.
<LogEntry>
<Stuff> stuff here </Stuff>
<LogEntryDate>date time here</LogEntryDate>
</LogEntry>
....
<LogEntry>
<Stuff> stuff here </Stuff>
<LogEntryDate>date time here</LogEntryDate>
</LogEntry>
Now, I'd like to use XMLSerialization, but when appending I get the <xml...>
line which I don't want after the first entry.
<?xml version="1.0" encoding="utf-8"?>
Is there a way to use XMLSerializer so that when appending, this line is not
added?
Here is my current code, which creates the file if it doesn't exist,
otherwise appends the next chunk of xml.
XmlSerializer ser = new XmlSerializer(typeof(MyClass));
bool bAppend = true;
TextWriter writer = new StreamWriter(strUsageLogFileName, bAppend );
ser.Serialize(writer, this);
writer.Close();
Thanks for any tips,
Frank