c# - XML - Serialize class - Some questions -


I have the idea of ​​serializing the properties of a class in an XML-file and then uploading this file to the server The reason for this is that I want to download this file again and read the serialized content.

Then this kind of structure:

file exists (myfile.xml) - & gt; Serialize the file in data from class (myclass.cs) - & gt; Upload file.

Now the content may look something like this:

   

Now the problem is, I do not know how to walk. I want the new data to be serialed in the next way, but it should be linked to that XML-file, not a new one. So I download this file and then I serialize the new data as an attachment so that it will look like this:

    

And it should be repeated many times as I want: download file, serial new data and attach it together, then upload it again. Now, the second issue is, I want to read it.

I also use XML-class for this. For the type of ultimate type, the data should be serialized, I set the square in which the assets are. But now, there are more nodes of the same name in my XML. I want to separate it now, therefore, not just a class, but a new class with the same name for each node.

To show you that a little bit is clear:

We have the first couple in XML (some properties, some propertybased). It should now be deserialized on myclass.cs, which has the correct properties for XML-nodes. Example:

  Public Class MyClass {Public Version SomeProperty {get; Set;} public string SomeProeprtiesChild {get; Set;}}   

and then the first XML-pair must be distritted to that class. But I want to do this for each XML- "pair" in my XML file, but in my head I can not find the right structure. Should I make a list here or how should I do this? I really hope that I can clarify it clearly, it is very difficult to explain. Apart from this, I do not know how to engage with it. any suggestion?

If you have any questions, Ask !

What you see is not just a serialization. Do you want to sort the same object more than once?

A possible solution list to be serialized and if the file exists, then the list includes new instances. / P>

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -