Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. using Messages;
  6. using Newtonsoft.Json;
  7.  
  8. namespace Data
  9. {
  10.     public class jsonHandler
  11.     {
  12.         public static void listToJson(List<message> messages)
  13.         {
  14.             string json = JsonConvert.SerializeObject(messages, Formatting.Indented);
  15.             File.WriteAllText("Messages.json", json);
  16.         }
  17.     }  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement