Holds settings for application
Beispiel #1
0
        /// <summary>
        /// Class constructor
        /// </summary>
        public Session(Config.Settings settings)
        {
            /*Initialize globals*/
            mSettings = settings;
            mLog = new Log("accounts.txt", 3);

            /*Start our main thread*/
            mSearchThread = new Thread(Work);
            mSearchThread.Start();
        }
        /// <summary>
        /// Class constructor
        /// </summary>
        public Session(Config.Settings settings)
        {
            /*Initialize globals*/
            mSettings = settings;
            mLog = new Log("accounts.txt", 1);
            //LoadProxies(); not needed for hotmail only

            /*Start our main thread*/
            mSearchThread = new Thread(Work);
            mSearchThread.Start();
        }
Beispiel #3
0
        /// <summary>
        /// Class constructor
        /// </summary>
        public Session(Config.Settings settings)
        {
            /*Initialize globals*/
            mSettings = settings;
            mLog      = new Log("accounts.txt", 1);
            //LoadProxies(); not needed for hotmail only

            /*Start our main thread*/
            mSearchThread = new Thread(Work);
            mSearchThread.Start();
        }
Beispiel #4
0
        /// <summary>
        /// Read or write settings for application
        /// </summary>
        /// <returns>Returns null if settings was not read</returns>
        public static Config.Settings Read()
        {
            string fileName = "Settings.json";

            if (File.Exists(fileName))
            {
                /*File exist, so we'll parse the information here*/
                string setJson = File.ReadAllText(fileName);
                if (!string.IsNullOrWhiteSpace(setJson))
                {
                    try
                    {
                        /*Return deserialized json string*/
                        return(JsonConvert.DeserializeObject <Config.Settings>(setJson));
                    }
                    catch (JsonException jEx)
                    {
                        /*Incorrect format probably*/
                        Console.WriteLine("Error parsing {0}\n{1}", fileName, jEx.ToString());
                        File.Delete(fileName);
                        Thread.Sleep(1500);
                    }
                }
            }
            else
            {
                /*File doesn't exist, we'll create it here*/
                var settingsClass = new Config.Settings()
                {
                    /*Temp values*/
                    startId      = 5000,
                    endId        = 10000,
                    requestLimit = 50,
                    checkHotmail = true
                };

                /*Write file*/
                string djson = JsonConvert.SerializeObject(settingsClass, Formatting.Indented);
                Console.WriteLine("{0} has been written. Edit the settings and launch the program again.", fileName);
                File.WriteAllText(fileName, djson);
                Thread.Sleep(1500);
            }

            return(null);
        }
Beispiel #5
0
        /// <summary>
        /// Main functions
        /// Set settings and start session
        /// </summary>
        /// <param name="args">No args</param>
        static void Main(string[] args)
        {
            /*Read settings*/
            mSettings = Settings.Read();
            if (mSettings == null)
                return;

            /*Start session*/
            mSession = new Session(mSettings);

            /*Keep us alive*/
            while (true)
            {
                /*Update title with number of account found from session*/
                Console.Title = string.Format("Zute | LowDig | Accounts found: {0}", mSession.mAccountsFound);
                Thread.Sleep(100);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Read or write settings for application
        /// </summary>
        /// <returns>Returns null if settings was not read</returns>
        public static Config.Settings Read()
        {
            string fileName = "Settings.json";
            if (File.Exists(fileName))
            {
                /*File exist, so we'll parse the information here*/
                string setJson = File.ReadAllText(fileName);
                if (!string.IsNullOrWhiteSpace(setJson))
                {
                    try
                    {
                        /*Return deserialized json string*/
                        return JsonConvert.DeserializeObject<Config.Settings>(setJson);
                    }
                    catch (JsonException jEx)
                    {
                        /*Incorrect format probably*/
                        Console.WriteLine("Error parsing {0}\n{1}", fileName, jEx.ToString());
                        File.Delete(fileName);
                        Thread.Sleep(1500);
                    }
                }
            }
            else
            {
                /*File doesn't exist, we'll create it here*/
                var settingsClass = new Config.Settings()
                {
                    /*Temp values*/
                    startId = 5000,
                    endId = 10000,
                    requestLimit = 50,
                    checkHotmail = true
                };

                /*Write file*/
                string djson = JsonConvert.SerializeObject(settingsClass, Formatting.Indented);
                Console.WriteLine("{0} has been written. Edit the settings and launch the program again.", fileName);
                File.WriteAllText(fileName, djson);
                Thread.Sleep(1500);
            }
            
            return null;
        }
Beispiel #7
0
        /// <summary>
        /// Main functions
        /// Set settings and start session
        /// </summary>
        /// <param name="args">No args</param>
        static void Main(string[] args)
        {
            /*Read settings*/
            mSettings = Settings.Read();
            if (mSettings == null)
            {
                return;
            }

            /*Start session*/
            mSession = new Session(mSettings);

            /*Keep us alive*/
            while (true)
            {
                /*Update title with number of account found from session*/
                Console.Title = string.Format("Zute | LowDig | Accounts found: {0}", mSession.mAccountsFound);
                Thread.Sleep(100);
            }
        }