Skip to main content

Parse fromde Json in c#em C#

I'm trying to parse a json toEstou a tentar fazer parse de Json para uma listbox and i'm not having successe não estou a ter sucesso.

This urlEste https://api.tibiadata.com/v2/characters/Trollefar.jsonurl is an example of what i'm trying toé um exemplo do que eu estou a tentar fazer parse... and this is what I havee isto é o que eu tenho:

 public void button1_Click(object sender, EventArgs e)
    {

        dynamic m = JsonConvert.DeserializeObject(@"https://api.tibiadata.com/v2/characters/"+textBox1.Text+".json");
        string name = m.Name;
        listBox1.Items.Add(name);

    }

and this is the errorE tenho este erro:

Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: h. Path '', line 0, position 0.'

Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: h. Path '', line 0, position 0.'

Parse from Json in c#

I'm trying to parse a json to a listbox and i'm not having success.

This url https://api.tibiadata.com/v2/characters/Trollefar.json is an example of what i'm trying to parse... and this is what I have:

 public void button1_Click(object sender, EventArgs e)
    {

        dynamic m = JsonConvert.DeserializeObject(@"https://api.tibiadata.com/v2/characters/"+textBox1.Text+".json");
        string name = m.Name;
        listBox1.Items.Add(name);

    }

and this is the error:

Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: h. Path '', line 0, position 0.'

Parse de Json em C#

Estou a tentar fazer parse de Json para uma listbox e não estou a ter sucesso.

Este url é um exemplo do que eu estou a tentar fazer parse... e isto é o que eu tenho:

public void button1_Click(object sender, EventArgs e)
{

    dynamic m = JsonConvert.DeserializeObject(@"https://api.tibiadata.com/v2/characters/"+textBox1.Text+".json");
    string name = m.Name;
    listBox1.Items.Add(name);

}

E tenho este erro:

Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: h. Path '', line 0, position 0.'

Fonte Link

Parse from Json in c#

I'm trying to parse a json to a listbox and i'm not having success.

This url https://api.tibiadata.com/v2/characters/Trollefar.json is an example of what i'm trying to parse... and this is what I have:

 public void button1_Click(object sender, EventArgs e)
    {

        dynamic m = JsonConvert.DeserializeObject(@"https://api.tibiadata.com/v2/characters/"+textBox1.Text+".json");
        string name = m.Name;
        listBox1.Items.Add(name);

    }

and this is the error:

Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: h. Path '', line 0, position 0.'