I have a little problem.
When I'm using DataContractJsonSerializer with complex types(own types) it works fine. But I have to deserialize TimeStamp or DateTime from a string. So I cant mark these types with DataContract, DataMember attributes.
I wrote some code
string jsonedTS = "PT2M15S";
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(TimeSpan));
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonedTS));
try {
    result.Takes = (TimeSpan) jsonSerializer.ReadObject(ms);
} catch {
 ;
}
And I catch this Exception
{"There was an error deserializing the object of type System.TimeSpan. Encountered unexpected character 'P'."} System.Exception {System.Runtime.Serialization.SerializationException}
And My Question IS How Can I deserialize开发者_StackOverflow社区
You can try with Json.Net library - it's worked pretty well for us in the past.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论