相关疑难解决方法(0)

JSON无法反序列化为对象,需要数组吗?

我试图获取传入的JSON项目并将它们绑定到列表框项目,但我被视觉工作室告知我需要做一个数组而不是对象?我从来没有这样做过......任何人都知道怎么做?

我的RootObject:

public class RootObject
{
    public string url { get; set; }
    public string display { get; set; }
    public List<string> genetics { get; set; }
    public List<string> price { get; set; }
    public List<string> brandMaker { get; set; }
    public string form { get; set; }
    public string dosornos { get; set; }
    public string qty { get; set; }
    public string mfg { get; set; }
    public string mobURI { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

注意:Genetics,Price,BrandMaker实际上并不返回任何值,而是返回值,如下所示:

"genetics": [ …
Run Code Online (Sandbox Code Playgroud)

c# json windows-phone-7 windows-phone windows-phone-7.1

3
推荐指数
2
解决办法
1万
查看次数