문제

Hello i making request/respomse then i read with StreamReader the data that i get to string, and this data is Json type,i need to make my string (with Json data) readable convert it to object that i can use all data that i need

{"success":true,"errorInfo":{"errorCode":null,"errorTitle":null,"errorDescription":null,"errorKeyTitle":null,"errorKeyDescription":null,"debugMessage":null,"debugTrace":null},"data":{"cuenta":null,"periodo":null,"importe":null,"conceptos":null,"divisa":null,"descCtaIban":"01824649840201502683","descEmpresa":"VISONIC IBERICA DE SEGURIDAD S.L.","descOficina":"TB BARCELONA","descBanco":"BANCO BILBAO VIZCAYA ARGENTARIA S.A.","paginacionTLSMT016":"","paginacionTLSMT017":"M201311050001+0000000000000591800","codError":0,"codRetorno":0,"descripcion":"OK","movimientos":[{"descConceptoTx":"RECIBO DE ALQUILER","descConcepto":"RECIBO DE ALQUILER              ","codOficinaOrigen":"4649","numeroTalon":"000000000","indicadorDH":"D","divisaOrigen":null,"codigoMes":"QJ","fechaDocumento":"20140502","identificadorDocumento":"000000954639718","bancoProducto":"0182","oficinaProducto":"4649","contrapartidaProducto":"0020","folioProducto":"00000000150268","fechaContable":"02/05/2014","fechaValor":"02/05/2014","importe":"-1.184,99","saldo":"0,00","codigo":"0734","concepto":"N 2014122001830697 ARVAL SERV","oficina":"TB BARCELONA","divisa":"EUR","pais":"ES","cuenta":"01824649840201502683","banco":"BANCO BILBAO VIZCAYA ARGENTARIA S.A.","infAdicional":"4649","importeTotal":true,"saldoContable":"","saldoValor":""},{"descConceptoTx":"TRASPASO DE APUNTES AGRUPADOS","descConcepto":"TRASPASO DE APUNTES AGRUPADOS   ","codOficinaOrigen":"4649","numeroTalon":"000000000","indicadorDH":"H","divisaOrigen":null,"codigoMes":"","fechaDocumento":"00010101","identificadorDocumento":"000000000000000","bancoProducto":"0000","oficinaProducto":"0000","contrapartidaProducto":"0000","folioProducto":"00000000000000","fechaContable":"02/05/2014","fechaValor":"02/05/2014","importe":"1.184,99","saldo":"1.184,99","codigo":"0422","concepto":"TRASP. DST: 4649-010-0150040","oficina":"TB BARCELONA","divisa":"EUR","pais":"ES","cuenta":"01824649840201502683","banco":"BANCO BILBAO VIZCAYA ARGENTARIA S.A.","infAdicional":"4649","importeTotal":true,"saldoContable":"","saldoValor":""},
도움이 되었습니까?

해결책

The JSON you posted is invalid. It's probably truncated.

Use the following link to auto generate an object http://json2csharp.com/

Assuming your root class name is RootObject

Then call the following code

var result = JsonConvert.DeserializeObject<RootObject>(json);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top