public static void WriteData() { UserInfo info = new UserInfo { username = username, password = password, logFile = logFile, displayName = displayName, sentryFile = sentryFile, cll = CLL, fll = FLL }; string json = JsonConvert.SerializeObject(info, Formatting.Indented); File.WriteAllText("login.json", json); }
/// <summary> /// Writes login data to username/login.json /// </summary> public static void WriteData() { UserInfo info = new UserInfo { username = username, password = password, logFile = logFile, displayName = displayName, sentryFile = sentryFile, cll = CLL, fll = FLL, sharedSecret = sharedSecret }; string json = JsonConvert.SerializeObject(info, Formatting.Indented); if(!Directory.Exists(username + "/")) { Directory.CreateDirectory(username + "/"); } File.WriteAllText(username + "/login.json", json); if(!File.Exists("chatbots.txt")) { File.Create("chatbots.txt"); } if (!File.ReadAllText("chatbots.txt").Contains(username + "\n")) { File.AppendAllText("chatbots.txt", username + "\n"); } }