Hi,
I have a problem and i dont know what i should do about it.
I am using XMLSerialization to write the XML like
XmlSerializer s = new XmlSerializer(typeof(Config));
TextWriter w = new StreamWriter(ConfigFileName);
s.Serialize(w, this);
w.Flush();
w.Dispose();
w.Close();
now i want the XML to be like
<Extension>Mp3</Extensions>
and it has to an array.
I am doing like this
[XmlArrayAttribute("Extensions")]
public string[] Extension = new string[0];
and the class like
public class Extension
{
public string Extention;
}
Please see the commented part for more on the class.
Now as i write the Xml it gives me the output like
<String>Mp3</String>
I know i have to implement the class to achieve this but when i am trying to write the XML it says it cannot write the xml as only non parametrized constructor need. Is it like serialization can be done only for default constructor and not for the user defined constructor for a class.
This is one issue and the other issue is,
HOW TO DO IT. Please reply. Thanks in Adv.