How to (xml) serialize a uri

前端 未结 6 2302
南笙
南笙 2020-12-18 20:02

I have a class I\'ve marked as Serializable, with a Uri property. How can I get the Uri to serialize/Deserialize without making the property of type string?

6条回答
  •  不知归路
    2020-12-18 20:50

    Implement and IDeserializationCallback and use that field on your own.

    http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ideserializationcallback.aspx

提交回复
热议问题