在VB.NET / C#中反序列化JSON数组 [英] Deserialize JSON array in VB.NET / C#

查看:94
本文介绍了在VB.NET / C#中反序列化JSON数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#json#asp.net

大家好,我有一个网络服务,给我一个这种格式的json:

如果是正面登录[67 ,1];

否定:[失败,为用户输入的数据不正确。]





如何正确反序列化?



谢谢大家



我尝试了什么:



i试用:

#json # asp.net
Hi everyone, I have a web service that gives me a json with this format:
in case of positive login ["67", 1];
in the negative: ["fail", "Data entered for the user is incorrect."]


how to properly deserialize?

thank you all

What I have tried:

i try with :

Dim ser As New JavaScriptSerializer()
Dim result = ser.Deserialize(Of LoginResult)(wsResult.ToString())

Public Class LoginResult
   Public Property idcliente As String
   Public Property idutente As String
End Class

推荐答案

我通过 JSON Formatter&验证器 [ ^ ]并且验证正常。



在C#中使用JSON& VB [ ^ 是为了回答像这样的问题而写的。您需要了解的所有内容都可以在文章中找到。
I ran your JSON sample through JSON Formatter & Validator[^] and it validates okay.

Working with JSON in C# & VB[^] was written to answer questions like this one. Everything that you need to know is found in the article.


这篇关于在VB.NET / C#中反序列化JSON数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆