我是新来的JSON。我试图从JSON字符串以填充我的目标“来源”:
public class Sources
{
public long[] SourceIds;
}
string jsonstring = " [\r\n {\r\n \"SourceIds\": 20181234\r\n }, \r\n
{\r\n \"SourceIds\": 20181234\r\n },\r\n {\r\n \"SourceIds\":
20181234\r\n }\r\n]"
我的目标是具有与“SourceIds”填充“的值源头”的一个目的。
提前致谢,
我怀疑你的实际JSON是象下面这样:
string jsonstring = " [
{
\"SourceIds\": 20181234
},
{
\"SourceIds\": 20181234
},
{
\"SourceIds\": 20181234
}
]"
您可序列化JSON的用
var result = JsonConvert.DeserializeObject<IList<Class1>>(String)
序列化类
public class Class1
{
public int SourceIds { get; set; }
}