30.06.2016, 06:56
To deserialize a JSON string you have to use JObject.parse.
Use jData("keyname") to retrieve any info from the JSON string.
PHP код:
Imports System.IO
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports System.Net
Module Module1
Sub Main()
Dim web As New WebClient
Dim reader As StreamReader = New StreamReader(web.OpenRead("http://monitor.sacnr.com/api/?IP=139.59.240.9&Port=7777&Action=info&Format=JSON"))
Dim jData As JObject = JObject.Parse(reader.ReadToEnd)
Console.WriteLine(jData("Hostname").ToString & " " & jData("Gamemode").ToString)
Console.ReadLine()
End Sub
End Module