title: Visual basic and Json.net Web request
body: <p>Basically what im trying to do is make a program that list game information for league of legends.. using there API to extract data. how this works is you Search there username and it returns an integer linked to that account, you then use that integer to search for all of the information for that account, EG account level, wins, losses, etc.
  I've run into a problem i can't seem to figure out.. Please not that I'm very new to Json.net so have little experience about working with it.. Below is how the search for the user ID is found, The First section is the Username Minus Any spaces in the name the next is the ID which is the information i require.</p>
  
  <pre><code>{"chucknoland":{"id":273746,"name":"Chuck Noland","profileIconId":662,"summonerLevel":30,"revisionDate":1434821021000}}
  </code></pre>
  
  <p>I must be declaring the variables wrong in order to obtain the data as everything i do it returns as 0. </p>
  
  <p>these are the following class i have to store the ID within </p>
  
  <pre><code>    Public Class ID
      Public Shared id As Integer
      Public Shared name As String
  End Class
  </code></pre>
  
  <p>Looking at a previous example seen here <a href="https://stackoverflow.com/questions/21676708/simple-working-example-of-json-net-in-vb-net">Simple working Example of json.net in VB.net</a></p>
  
  <p>They where able to resolve there issue by making a container class with everything inside it.. My problem is that The data i seek i always changing.. The first set will always be different to the "Chucknoland" that's displayed in the example.. is someone able to explain how i could go about extracting this information?</p>
  
  <p>Please note that the variables rRegion has the value of what server there on, Chuck Noland is on OCE, and sSearch is the Username.. Due to Problems with API keys i had to remove the API key from the code... But the URL returns the Json Provided.</p>
  
  <pre><code> 'URL string used to grab Summoner ID
      jUrlData = "https://oce.api.pvp.net/api/lol/" + rRegion + "/v1.4/summoner/by-name/" + sSearch + 
  
  
      ' Create a request for URL Data.
      Dim jsonRequest As WebRequest = WebRequest.Create(jUrlData)
  
      'request a response from the webpage
      Dim jsonResponse As HttpWebResponse = CType(jsonRequest.GetResponse(), HttpWebResponse)
  
      'Get Data from requested URL
      Dim jsonStream As Stream = jsonResponse.GetResponseStream()
  
      'Read Steam for easy access
      Dim jsonReader As New StreamReader(jsonStream)
  
      'Read Content
      Dim jsonResponseURL As String = jsonReader.ReadToEnd()
  
  
      jUrlString = jsonResponseURL
  </code></pre>
  
  <p>this is the request i have to obtain the information, and this is the code i tried to use to display the ID for that json.</p>
  
  <pre><code>    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  
      Dim obj As ID
  
      obj = JsonConvert.DeserializeObject(Of ID)(jUrlString)
  
      MsgBox(obj.id)
  
  
  End Sub
  </code></pre>
  
  <p>Is anyone able to explain how i can go about getting this to work?</p>