XML serialization of hash table(C#3.0)

前端 未结 3 566
一个人的身影
一个人的身影 2021-01-21 05:20

Hi I am trying to serialize a hash table but not happening

private void Form1_Load(object sender, EventArgs e)
        {
            Hashtable ht = new Hashtable         


        
3条回答
  •  醉酒成梦
    2021-01-21 05:41

    You can create your own Hashtable derived from standart Hashtable with implementation of IXmlSerializable. So you will implmenent ReadXml(XmlReader reader) & WriteXml(XmlWriter writer) where you can put your own logic on how to read and write values from your Hashtablw with given XmlReader & XmlWriter.

提交回复
热议问题