How to encode an array in json?

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts Page 1 of 1
Contributors
User avatar
KraZy
Top Poster
Top Poster
Posts: 93
Joined: Sat May 26, 2012 8:40 am

How to encode an array in json?
KraZy
Hi there,


I'm a bit rusty with vb.net and I need your help for encoding this:
Code: Select all
{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"saturday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"sunday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]}}
in json format in vb.net, how you can see this string is already decoded in json but I want know how I can create an array or something like for store the days with the break time. Essentially:
Code: Select all
"monday":{
"start":"09:00",
"end":"18:00",
"breaks":[
{
"start":"11:20",
"end":"11:30"
},
{
"start":"14:30",
"end":"15:00"
}
]
},
"tuesday":{
"start":"09:00",
"end":"18:00",
"breaks":[
{
"start":"11:20",
"end":"11:30"
},
{
"start":"14:30",
"end":"15:00"
}
]
},
Someone could help me to create the array with this contents and convert it into json? Thanks.
I'm in the empire business.
User avatar
MrGeneralQ
New Member
New Member
Posts: 16
Joined: Sun Aug 30, 2015 7:16 pm

Vb.net doesnt support json
You can still do it but iets nearly impossible.
Json is for PHP or Java
User avatar
visualtech
VIP - Donator
VIP - Donator
Posts: 265
Joined: Sat Nov 19, 2011 2:19 pm

I am sorry, but you're utterly wrong here MrGeneralQ. VB.NET does support JSON, but with a library. You can very easily do it in VB.NET. Lastly, JSON is for Ruby, PHP, Python or any other language. It was essentially drafted for backends since it was easier and faster than XML. Since Java, PHP are mainly backend languages, it would've been wise to include the JSON engine. For VB.NET, that wasn't the case; so, libraries.
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

This topic may help:
http://www.codenstuff.com/forum/viewtop ... 38&t=11520

Also I'll respond to PM's when I have time to get through them.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
KraZy
Top Poster
Top Poster
Posts: 93
Joined: Sat May 26, 2012 8:40 am

Re: How to encode an array in json?
KraZy
CodenStuff wrote:
This topic may help:
http://www.codenstuff.com/forum/viewtop ... 38&t=11520

Also I'll respond to PM's when I have time to get through them.
Okay I've fixed with the .JSON library, anyway, let me update for the pv message it's important
I'm in the empire business.
5 posts Page 1 of 1
Return to “Tutorial Requests”