[C#] 纯文本查看 复制代码
namespace Tester
{
class Program
{
[STAThread]
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder();
sb.Append("[");
sb.Append("{\"node\":{\"companyId\":230569695,\"levelCode\":\"2,,\",\"text\":\"001\",\"value\":300648756},\"branch\":\"ajaxImageGroup.htm?event=listSubGroups&levelCode=2,,&value=300648756&text=001\"},");
sb.Append("{\"node\":{\"companyId\":230569695,\"levelCode\":\"4,,\",\"text\":\"artificial leather\",\"value\":301440617},\"branch\":\"ajaxImageGroup.htm?event=listSubGroups&levelCode=4,,&value=301440617&text=artificial leather\"},");
sb.Append("{\"node\":{\"companyId\":230569695,\"levelCode\":\"1,,\",\"text\":\"leather\",\"value\":300388275},\"branch\":\"ajaxImageGroup.htm?event=listSubGroups&levelCode=1,,&value=300388275&text=leather\"},");
sb.Append("{\"node\":{\"companyId\":230569695,\"levelCode\":\"3,,\",\"text\":\"shoe leatther\",\"value\":301420981},\"branch\":\"ajaxImageGroup.htm?event=listSubGroups&levelCode=3,,&value=301420981&text=shoe leatther\"}");
sb.Append("]");
List<Data> list = new List<Data>();
list = (List<Data>)JsonHelper.jsonDes<List<Data>>(sb.ToString());
}
}
public class Data
{
public NodeInfo node { get; set; }
public string branch { get; set; }
}
public class NodeInfo
{
public string companyId { get; set; }
public string levelCode { get; set; }
public string text { get; set; }
public string value { get; set; }
}
}
|