This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Read and parse Json

Hi all,

I know this is a kind of generic vb.net question but i can't figure out how to do.

I read a json from an external url.

I imported the library Newtonsoft.Json.dll into Dell and declared in my script in the proper way I think

#If Not SCRIPTDEBUGGER Then
References Newtonsoft.Json.dll
#End If
Imports Newtonsoft.Json

The json return is an array of object.

I don't know how to use the library to get a generic array of object where to retreive a field I could do just array[i].field.

Can anyone help me?

Parents
  • Hi

    Does that little example help you?

    string json = @"{
      'Name': 'Bad Boys',
      'ReleaseDate': '1995-4-7T00:00:00',
      'Genres': [
        'Action',
        'Comedy'
      ]
    }";
    
    Movie m = JsonConvert.DeserializeObject<Movie>(json);
    
    string name = m.Name;
    // Bad Boys

Reply
  • Hi

    Does that little example help you?

    string json = @"{
      'Name': 'Bad Boys',
      'ReleaseDate': '1995-4-7T00:00:00',
      'Genres': [
        'Action',
        'Comedy'
      ]
    }";
    
    Movie m = JsonConvert.DeserializeObject<Movie>(json);
    
    string name = m.Name;
    // Bad Boys

Children
No Data