Guest User

Untitled

a guest
Jun 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. UserControl1 UC = new UserControl1();
  2. string outputJSON = JsonConvert.SerializeObject(UC);
  3. File.WriteAllText("mifile.json", outputJSON);
  4.  
  5. public class PersonDto
  6. {
  7. public string FirstName { get; set; }
  8. public string LastName { get; set; }
  9. // ...
  10. }
  11.  
  12. public PersonDto Data
  13. {
  14. get
  15. {
  16. return new PersonDto
  17. {
  18. FirstName = this.FirstNameTextBox.Text,
  19. LastName = this.LastNameTextBox.Text,
  20. // ...
  21. }
  22. }
  23. }
  24.  
  25. UserControl1 UC = new UserControl1();
  26. // ...
  27. string outputJSON = JsonConvert.SerializeObject(UC.Data);
Add Comment
Please, Sign In to add comment