Example #1
0
        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);
        }
Example #2
0
        /// <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");
            }
        }