//Deserialize json with newtonsoft from IDE C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\docs public static void Deserialize() { string outputJSON = File.ReadAllText("docs/conf.json"); Instance = JsonConvert.DeserializeObject <Cconf>(outputJSON); selector = null; }
// Serialize json with newtonsoft, save document on IDE C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\docs public static void Serialize() { Cconf setvalues = new Cconf { //Variables Run Cloud urlRunCloud = "xxxxxxxx", urlOperationsPortal = "xxxxxxxx", urlBusinessInsigths = "xxxxxxxx", urlArtificialIntelligence = "xxxxxxxx", urlEnterprisePortal = "xxxxxxxx", browserTest = "xxxxx", userEmail = "*****@*****.**", userpass = "******", SuscriptionName = "ABC DEF GHI", projectName = "xxxxxxx", projectSumary = "xxxxxxxx", ListEnviroments = new string[, ] { { "xxx", "xxx", "xxx" }, { "xxx", "xxx", "xxx" } }, ListEnviromentsLoadBex = new string[, ] { { "xx", @"xxxxxx", "xxx", "xxx", "xx" } }, ListValuesCase = new string[, ] { { @"xxx", "xxx", "xxxx", "12345", "99999", @"xxxxxxxx", "99999", "xxxxx", "1234567", @"xxxxxxxxxx" } }, //Variables development elemenType = new string[] { "xx", "xxx", "xxxx" }, listBrowserTest = new string[] { "xxx", "xxx", "xxx" }, pathLog = new string[] { "xxxxx", "xxxxx", "xxxxx" }, waitVar = "0", CounItem = 0, userTimeWait = 0, }; string outputJSON = JsonConvert.SerializeObject(setvalues); File.WriteAllText("docs/conf.json", outputJSON); Console.WriteLine(outputJSON); }