"Price": 200, "Price": 900.77, "PrecoST": 225.19, "Description": " ASUS AMD RADEON R5 230 VIDEO CARD 1GB DDR3 64BITS R5230-SL-1GD3-L "IMP", "Group": "VIDEO PLATE", "Mark": "ASUS", "Source": 6, "NCM": "8473.30.43", "EAN": "0000000000000", " 0, "Width": 0, "Height": 0, "Depth": 0, "Warranty": "12 Months "," AliqIPI ": 0," AliqICMS ": 12," Unit ":" PC "," Multi-Sale ": 1," Link ":" https://www2.myusite.com/localnew/_img/ photos_products / 019076-3.jpg "," PartNumber ":" R5230-SL-1GD3-L "}]]}
I'm sending the code I'm developing ..
private void ButtonConvert_Click(object sender, EventArgs e)
{
string fileContents;
WebRequest request = WebRequest.Create(textBox1.Text);
WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
string html = String.Empty;
using (StreamReader sr = new StreamReader(data))
{
fileContents = sr.ReadToEnd();
}
richTextBox1.Text = fileContents;
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
Result paging = jsonSerializer.Deserialize<Result>(fileContents);
textBox2.Text = textBox2.Text + paging.Descricao;
for (int i = 0; i < 50; i++)
{
//richTextBox1.Text = richTextBox1.Text + paging.results[i].id + " ";
//richTextBox1.Text = richTextBox1.Text + paging.results[i].buyer.id + " ";
//richTextBox1.Text = richTextBox1.Text + paging.results[i].buyer.first_name + " ";
}
}
public class Result
{
public string CodigoReduzido { get; set; }
public int Estoque { get; set; }
public double Preco { get; set; }
public double PrecoST { get; set; }
public string Descricao { get; set; }
public string Grupo { get; set; }
public string Marca { get; set; }
public int Origem { get; set; }
public string NCM { get; set; }
public string EAN { get; set; }
public double PesoBruto { get; set; }
public int Largura { get; set; }
public int Altura { get; set; }
public int Profundidade { get; set; }
public string Garantia { get; set; }
public int AliqIPI { get; set; }
public int AliqICMS { get; set; }
public string Unidade { get; set; }
public int MultiploVenda { get; set; }
public string Link { get; set; }
public string PartNumber { get; set; }
}
public class RootObject
{
public List<Result> result { get; set; }
}
Using json2csharp generate c # classes from json
public class RootObject
{
public List<List<>> result { get; set; }
}
But I could not use it that way .. Now I think I've been able to explain better.
I appreciate the help of friends ...