-2
I have a link that I pass the CNPJ (https://www.receitaws.com.br/v1/cnpj/@cnpj) and it returns me a json with all the information, what is my doubt, how do I take this information as Social Reason, Name Fantazia, Address and Insert them in the textbox of the Application? I’ve tried a few things and I honestly can’t get out of place, they can help me?
I made an example that was passed on a site, I can even capture the whole result, but I can’t get the data inside that result:
var client = new Webclient(); var conteudo = client.Downloadstring("https://www.receitaws.com.br/v1/cnpj/@cnpj".Replace("@cnpj", txtCNPJ.Text));
Thank you.
Post your code so we can help you
– Robson Silva
Xmldocument doc = new Xmldocument(); Dataset ds = new Dataset(); var client = new Webclient(); var contents = client.Downloadstring("https://www.receitaws.com.br/v1/cnpj/@cnpj".Replace("@cnpj", txtCNPJ.Text); string on = content; Xnode Node = Jsonconvert.Deserializexnode(json, "Root"); string xml = Node.Tostring();ds.Readxml(xml); string check = ds. Tables[0]. Rows[0]["Result"]. Tostring(); if (verify == "1") { txtEndereco.Text = ds.Tables[0]. Rows[0]["street"]. Tostring(); }
– Paulo Copula
Just to understand you can get the data in the right xml format, and want to convert it to json is this ?
– Robson Silva
Come on, I get the Json data already but do not know how to take the result and play inside the system Textbox, in case you take the "Address" of the json and play in the textbox Address of the system understand? type separate the data to put in its places on the screen
– Paulo Copula