-
Convertir du format JSON
Bonjour,
Je souhaiterai connaitre la façon de convertir un fichier au format JSON en Visual Basic .NET afin de pouvoir l'utiliser dans mon application.
Existe-t'il une fonction similaire à "json_decode" (fonction php) ?
Si quelqu'un peut m'aider, je lui en serai très reconnaissant. Je n'ai actuellement aucune idée.
Merci beaucoup....
-
Il y a une bibliothéque pour ça: http://json.codeplex.com/
-
Exactement, probablement le meilleur framework JSON pour .NET
Un exemple avec un fichier : http://james.newtonking.com/projects/json/help/
-
Bonjour à tous,
Tous d'abord je tiens à vous remercier pour vos réponses. Néanmoins malgré plusieurs essais de compréhension je n'arrive toujours pas a désérialiser ce texte au format JSON :
Code:
{"feed":{"page":1,"count":5,"results":[{"type":"tvseries","$":4}],"totalResults":4,"tvseries":[{"code":64,"originalTitle":"Stargate SG-1","castingShort":{"creators":"Brad Wright, Jonathan Glassner","actors":"Ben Browder, Amanda Tapping, Michael Shanks, Christopher Judge, Beau Bridges"},"yearStart":1997,"yearEnd":2007,"statistics":{"userRating":3.37892},"poster":{"path":"\/medias\/nmedia\/18\/77\/28\/06\/19688695.jpg","href":"http:\/\/fr.web.img3.acsta.net\/medias\/nmedia\/18\/77\/28\/06\/19688695.jpg"},"link":[{"rel":"aco:web","href":"http:\/\/www.allocine.fr\/series\/ficheserie_gen_cserie=64.html"}]},{"code":3768,"originalTitle":"Stargate Universe","castingShort":{"creators":"Brad Wright, Robert C. Cooper","actors":"Robert Carlyle, David Blue, Justin Louis, Jamil Walker Smith, Brian J. Smith"},"yearStart":2009,"yearEnd":2011,"statistics":{"userRating":3.39347},"poster":{"path":"\/medias\/nmedia\/18\/72\/18\/55\/19155878.jpg","href":"http:\/\/fr.web.img5.acsta.net\/medias\/nmedia\/18\/72\/18\/55\/19155878.jpg"},"link":[{"rel":"aco:web","href":"http:\/\/www.allocine.fr\/series\/ficheserie_gen_cserie=3768.html"}]},{"code":212,"originalTitle":"Stargate: Atlantis","castingShort":{"creators":"Brad Wright, Robert C. Cooper","actors":"Joe Flanigan, David Hewlett, Robert Picardo, Rachel Luttrell, Jason Momoa"},"yearStart":2004,"yearEnd":2009,"statistics":{"userRating":2.92558},"poster":{"path":"\/medias\/nmedia\/18\/83\/37\/38\/19685694.jpg","href":"http:\/\/fr.web.img1.acsta.net\/medias\/nmedia\/18\/83\/37\/38\/19685694.jpg"},"link":[{"rel":"aco:web","href":"http:\/\/www.allocine.fr\/series\/ficheserie_gen_cserie=212.html"}]},{"code":4593,"originalTitle":"Stargate: Infinity","castingShort":{"creators":"Michael Maliani, Andy Heyward","actors":"Dale Wilson, Tifanie Christun, Bettina Bush, Mark Hildreth, Kathleen Barr"},"yearStart":2002,"yearEnd":2003,"statistics":{"userRating":2.68275},"poster":{"path":"\/medias\/nmedia\/18\/86\/52\/69\/19845607.jpg","href":"http:\/\/fr.web.img3.acsta.net\/medias\/nmedia\/18\/86\/52\/69\/19845607.jpg"},"link":[{"rel":"aco:web","href":"http:\/\/www.allocine.fr\/series\/ficheserie_gen_cserie=4593.html"}]}]}}
Si quelqu'un peut m'apporter une aide sur ce problème. Je le remercie d'avance.
Merci à tous...
-
Comment ça tu n'y arrives pas ? Ca ne veut pas dire grand chose !!
Poste ton code, et si tu as un message d'erreur, indique-le pour qu'on puisse t'aider...
-
Si c'est pour trouver une classe équivalente, tu peux regarder ici : http://json2csharp.com/