i'm trying to get the session id out of a string looking like this:
{"url":"","port":1337,"status":"OK kPzKTe0SNYGRWsPxoiK8jg5qllvPLn7hG4MRFSjqU60w4525175","session":"kPzKTe0SNYGRWsPxoiK8jg5qllvPLn7hG4MRFSjqU60w4525175","username":"foobar","secret":"1c25687b71f183e53009dd0156becfe5","user_id":1337,"vip":0}
it's the id after "session": kPzKTe0SNYGRWsPxoiK8jg5qllvPLn7hG4MRFSjqU60w4525175
i tried alot with split and stuff but couldnt get it done so far. any ideas? btw: the output isnt always same order. url status session change positions each time i request it.
Function MySplitFunction()
FrmConsole.Console.Text = FrmConsole.Console.Text & "[API] getting sid" & vbCrLf
Dim client As New WebClient
Dim sessionid As String = client.DownloadString("https://www.spin.de/api/login?login=usr;pw=pass;server=1337")
Dim Splitted() As String = sessionid.Split(New String() {"""session""", ","}, StringSplitOptions.None)
FrmConsole.Console.Text = FrmConsole.Console.Text & "SID: " & Splitted(1) & vbCrLf
End Function
Copy your JSON text to the clipboard then use
Edit>Paste Special>Paste JSON as Classesto create your class. Then useSystem.Text.Jsonto deserialize: