Guest User

Untitled

a guest
Jul 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. {
  2. "2010": [
  3. {
  4. "type": "vacation",
  5. "alloc": "90.00"
  6. },
  7.  
  8. {
  9. "year": [],
  10. "2010": [
  11. {
  12. "type": "vacation",
  13. "alloc": "0.00"
  14. },
  15.  
  16. static void Main(string[] args) {
  17.  
  18. var json = @"
  19. {
  20. '2010': [
  21. {
  22. 'type': 'vacation',
  23. 'alloc': '90.00'
  24. },
  25. {
  26. 'type': 'something',
  27. 'alloc': '80.00'
  28. }
  29. ]}";
  30.  
  31.  
  32. var jss = new JavaScriptSerializer();
  33. var obj = jss.Deserialize<dynamic>(json);
  34.  
  35. Console.WriteLine(obj["2010"][0]["type"]);
  36.  
  37. Console.Read();
  38.  
  39. }
Add Comment
Please, Sign In to add comment