private void button2_Click(object sender, EventArgs e) { string s = "{\"X\":100,\"Y\":200,\"Name\":\"TC \"}"; TLocation obj = JsonConvert.DeserializeObject <TLocation>(s); button2.Text = obj.Name; }
private void button1_Click(object sender, EventArgs e) { TLocation obj = new TLocation() { X = 100, Y = 200, Name = "TC " }; string s = JsonConvert.SerializeObject(obj); textBox1.Text += s + System.Environment.NewLine + System.Environment.NewLine; }