Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UserControl1 UC = new UserControl1();
- string outputJSON = JsonConvert.SerializeObject(UC);
- File.WriteAllText("mifile.json", outputJSON);
- public class PersonDto
- {
- public string FirstName { get; set; }
- public string LastName { get; set; }
- // ...
- }
- public PersonDto Data
- {
- get
- {
- return new PersonDto
- {
- FirstName = this.FirstNameTextBox.Text,
- LastName = this.LastNameTextBox.Text,
- // ...
- }
- }
- }
- UserControl1 UC = new UserControl1();
- // ...
- string outputJSON = JsonConvert.SerializeObject(UC.Data);
Add Comment
Please, Sign In to add comment