Advertisement
Guest User

Untitled

a guest
May 9th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Deserializing JSON error
  2. void proxy_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
  3. {
  4. DataContractJsonSerializer(typeof(Employee));
  5.  
  6. Employee myPerson = new Employee();
  7. MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(e.Result));
  8. System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(myPerson.GetType());
  9. myPerson = serializer.ReadObject(ms) as Employee;
  10. ms.Close();
  11. }
  12.  
  13. "{"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