Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Deserializing JSON error
- void proxy_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
- {
- DataContractJsonSerializer(typeof(Employee));
- Employee myPerson = new Employee();
- MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(e.Result));
- System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(myPerson.GetType());
- myPerson = serializer.ReadObject(ms) as Employee;
- ms.Close();
- }
- "{"data":{"__type":"Employee:#MyProject","address":"sdf","idEmployee":1,"name":"john","phoneNumber":"070"},"message":"","status":"ok"}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement