-
-
Save atifaziz/5249 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"logon": "[email protected]", | |
"addresses": [ | |
{ | |
"shippingAddressCount":"2", | |
"shipping": [ | |
{ | |
"firstName": "John", | |
"lastName": "Smith", | |
"address1": "111 Fake St.", | |
"address2": "", | |
"city": "New York", | |
"state": "NY", | |
"zip": "11111" | |
}, | |
{ | |
"firstName": "John", | |
"lastName": "Smith", | |
"address1": "222 Fake St.", | |
"address2": "", | |
"city": "New York", | |
"state": "NY", | |
"zip": "11111" | |
} | |
], | |
"billing": { | |
"firstName": "John", | |
"lastName": "Smith", | |
"address1": "111 Fake St.", | |
"address2": "", | |
"city": "New York", | |
"state": "NY", | |
"zip": "11111" | |
}, | |
"marketing": { | |
"addressId": "12345", | |
"firstName": "John", | |
"lastName": "Smith", | |
"address1": "111 Fake St.", | |
"address2": "", | |
"city": "New York", | |
"state": "NY", | |
"zip": "11111", | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Test code for thread: | |
' http://groups.google.com/group/jayrock/t/936408c0b8034d83 | |
Imports System.IO | |
Imports System.Collections | |
Imports Jayrock.Json.Conversion | |
Module MainModule | |
Sub Main() | |
Dim root As IDictionary = JsonConvert.Import(File.ReadAllText("json.txt")) | |
Dim logon As String = root("logon") | |
Console.WriteLine("logon: " & logon) | |
Dim addresses As IList = root("addresses") | |
For Each address As IDictionary In addresses | |
For Each shipping As IDictionary In address("shipping") | |
Console.WriteLine() | |
Dump(shipping, Console.Out) | |
Next | |
Console.WriteLine() | |
Dump(address("billing"), Console.Out) | |
Next | |
End Sub | |
Sub Dump(ByVal address As IDictionary, ByVal output As TextWriter) | |
output.WriteLine("firstName: " & address("firstName")) | |
output.WriteLine("lastName : " & address("lastName")) | |
output.WriteLine("address1 : " & address("address1")) | |
output.WriteLine("address2 : " & address("address2")) | |
output.WriteLine("city : " & address("city")) | |
output.WriteLine("state : " & address("state")) | |
output.WriteLine("zip : " & address("zip")) | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment