VB.NET HELP[REP+]
#8

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.
Reply


Messages In This Thread
VB.NET HELP[REP+] - by dh240473 - 29.06.2016, 10:39
Re: VB.NET HELP[REP+] - by Owen007 - 29.06.2016, 11:22
Re: VB.NET HELP[REP+] - by RaeF - 29.06.2016, 11:55
Re: VB.NET HELP[REP+] - by iKarim - 29.06.2016, 12:43
Re: VB.NET HELP[REP+] - by BroZeus - 29.06.2016, 12:49
Re: VB.NET HELP[REP+] - by iKarim - 29.06.2016, 13:02
Re: VB.NET HELP[REP+] - by dh240473 - 30.06.2016, 06:32
Re: VB.NET HELP[REP+] - by iKarim - 30.06.2016, 06:56
Re: VB.NET HELP[REP+] - by dh240473 - 30.06.2016, 07:19

Forum Jump:


Users browsing this thread: 1 Guest(s)