If you need to save/load state information to an XML file, this will work:
Serializes an object's state information (properties) to an XML file:
XmlSerializer ser = new XmlSerializer(typeof(MyClass));
TextWriter write = new StreamWriter("MyClass.xml");
ser.Serialize(write, this);
write.Close();
Deserializes an XML file and restores state information to a class:
XmlSerializer ser = new XmlSerializer(typeof(MyClass));
TextReader reader = new StreamReader("MyClass.xml");
MyClass mc = (MyClass) ser.Deserialize(reader);
reader.Close();
Perhaps this is what you were looking for. If not, please elaborate on what
you are attempting to do.
-Noah Coad
Microsoft MVP & MCP
"Robert Fischbacher" <Ro****************@t-online.de> wrote in message
news:5a**************************@posting.google.c om...
Hello,
does anybody know if there is a existing tool that can convert valid
C# Code to a XML structure? I tried to parse a C# program to analyze
the structure of the existing program code, but it's really, really
very complicated. So, if there would be a existing tool that converts
the C# file to XML it should be easier to parse then the XML file.
Because the CreateParser method of the CodeDomProvider class does not
work, I now try to find an other method to parse the C# code.
Do you have any ideas? Thanks.
Greetings
Robby