the above answer of @styx works but I have already change my code. This answer is for additional information only.
I created a class named PerInfo
public class PerInfo
public firstname
public lastname
end class
To serialize I wrote this;
dim x as new PerInfo
x.firstname = textbox1.text
x.address = textbox2.text
dim res as string = JsonConvert.SerializeObject(x)
' the above code produces my desired result which is
' {"firstname":"jeo","address":"GSC"}
To deserialized I did this;
Dim t As PerInfo = JsonConvert.DeserializeObject(Of PerInfo)(x)
'I can now access the `firstname` and `address` via
' t.firstname and t.address
MsgBox(t.firstname & "===" & t.address)
Hope this helps...
PS: I manually added via add reference the Newtonsoft.Json.dll
version Net 2.0 for backward compatibility for pc using .net 2.0 framework if I'm right. Feel free to correct me with this.