0

really need help, i need to make somehow to read from JSON array to VB.net string, specific value , this is my eg of array http://playnet.pro/client-files/gtracker/server.php?game=cssource&ip=216.52.148.47&port=27015

I made stream reader

Dim address As String = "http://playnet.pro/client-files/gtracker/server.php?game=cssource&ip=216.52.148.47&port=27015"
    Dim client As WebClient = New WebClient()
    Dim reader As StreamReader = New StreamReader(client.OpenRead(address))
    Dim array As String = reader.ReadToEnd

but how to find my values or filter it? Thank you

drdrift
  • 1
  • 1
  • You need to convert the PHP array to JSON on server side – Arsal Imam Oct 31 '15 at 21:12
  • Basically, JSON will create an interface between VB.NET and PHP – Arsal Imam Oct 31 '15 at 21:14
  • Ok i changed now file to json http://playnet.pro/client-files/gtracker/server.php?game=cssource&ip=216.52.148.47&port=27015 , but i dont know how to read json specific value in vb.net – drdrift Oct 31 '15 at 21:19
  • Are you using [Json.Net](https://www.nuget.org/packages/Newtonsoft.Json/)? did you try to deserialize the data via [JsonConvert.DeserializeObject](http://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_JsonConvert_DeserializeObject.htm)? – Yacoub Massad Nov 01 '15 at 00:10

1 Answers1

0

For parsing JSON in VB.NET, you have option to use any one of the below libraries:

*) Newtonsoft.Json library You can use this from here

Tutorial: https://stackoverflow.com/a/20080586/4360419

*) JSON.NET library You can use this from here

Tutorial: You can also find the tutorial of this from the same side

You can also generate your VB.NET classes by your JSON from the below link http://jsontodatacontract.azurewebsites.net/

Community
  • 1
  • 1
Arsal Imam
  • 2,882
  • 2
  • 24
  • 35