1
How to convert this JSON to a C object#?
{
"Maquinas":{
"Maquina1":[
{
"comando":"Get",
"enderecoip":"192.168.254.221",
"port":"3000",
"usuario":"teste",
"Senha":"123456"
},
{
"comando":"sendFuncionarios",
"enderecoip":"192.168.140.221",
"port":"3000",
"usuario":"teste fabrica",
"Senha":"111111",
"funcionariosHA":[
{
"nome":"Daril Mont",
"pis":"1234567891",
"verdigital":false,
"codigo":30
},
{
"nome":"Mont Daril",
"pis":"62633975303",
"verdigital":true,
"codigo":31
}
]
},
{
"comando":"sendEmpresa",
"enderecoip":"192.168.140.221",
"port":"3000",
"usuario":"fabrica",
"Senha":"123456",
"EmpresaHexaAdv":[
{
"razaoSocial":"Oficina de Computadores",
"tipoCadastro":"CNPJ",
"CPF":"",
"CNPJ":"20330852471",
"endereco":"R. Mariana, 265",
"CEI":""
}
]
}
],
"Maquina2":[
{
"comando":"Get",
"enderecoip":"192.168.210.223",
"port":"51000",
"cpf":"13556285630"
},
{
"comando":"sendFuncionarios",
"enderecoip":"192.168.210.223",
"port":"51000",
"cpf":"13556285630",
"funcionariosInnerREP":[
{
"nome":"Dorval Miguel",
"pis":"1234567891",
"verdigital":false,
"codigo":30,
"senha":"0030"
},
{
"nome":"Leticia do Carmo",
"pis":"62633975303",
"verdigital":true,
"codigo":31,
"senha":"0031"
}
]
},
{
"comando":"sendEmpresa",
"enderecoip":"192.168.210.223",
"port":"51000",
"cpf":"13556285630",
"EmpresaInnerREP":[
{
"razaoSocial":"Oficina de Computadores",
"tipoCadastro":"CNPJ",
"CPF":"",
"CNPJ":"20330852471",
"endereco":"Rua abacate 25",
"CEI":""
}
]
}
]
}
}
your question has been answered here https://answall.com/questions/706/comoraconverter-uma-resposta-em-json-para-um-objeto-em-c
– Julio Henrique
@Victorwillian
Maquinas
will only have two attributesMaquina1
andMaquina2
if this number may vary you will have to change your Json– Leandro Angelo