Posts: 579
Threads: 5
Joined: Oct 2015
That kind of object can't be used in .NET AFAIK.
Posts: 579
Threads: 5
Joined: Oct 2015
Best JSON library for .NET is
JSON.Net
Posts: 579
Threads: 5
Joined: Oct 2015
To deserialize a JSON string you have to use JObject.parse.
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
Use jData("keyname") to retrieve any info from the JSON string.