Пример #1
0
        static void Main(string[] argv)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool ConfigExist = Config.ConfigFileExist();

            Config.InitializeConfig();

            if (Config.ConfigData.LogToFile)
            {
                Logger.ConfigureWithFile();
            }

            if (Config.ConfigData.DebugConsole)
            {
                Helpers.AllocConsole();
            }

            Helpers.ConsolePrint("NICEHASH", "Starting up NiceHashMiner v" + Application.ProductVersion);

            string tmp;

            if (!ConfigExist && !ParseCommandLine(argv, "-lang", out tmp))
            {
                Helpers.ConsolePrint("NICEHASH", "No config file found. Running NiceHash Miner for the first time. Choosing a default language.");
                Application.Run(new Form_ChooseLanguage());
            }

            // Init languages
            International.Initialize(Config.ConfigData.Language);

            if (argv.Length > 0)
            {
                if (ParseCommandLine(argv, "-lang", out tmp))
                {
                    int lang;
                    if (Int32.TryParse(tmp, out lang))
                    {
                        Helpers.ConsolePrint("NICEHASH", "Language is overwritten by command line parameter (-lang).");
                        International.Initialize(lang);
                        Config.ConfigData.Language = lang;
                    }
                }

                if (ParseCommandLine(argv, "-config", out tmp))
                {
                    Application.Run(new Form1(true));
                }
            }

            Application.Run(new Form1(false));
        }
Пример #2
0
        static void Main(string[] argv)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var commandLineArgs = new CommandLineParser(argv);

            bool ConfigExist = Config.ConfigFileExist();

            Config.InitializeConfig();

            if (Config.ConfigData.LogToFile)
            {
                Logger.ConfigureWithFile();
            }

            if (Config.ConfigData.DebugConsole)
            {
                Helpers.AllocConsole();
            }

            Helpers.ConsolePrint("NICEHASH", "Starting up NiceHashMiner v" + Application.ProductVersion);

            if (!ConfigExist && !commandLineArgs.IsLang)
            {
                Helpers.ConsolePrint("NICEHASH", "No config file found. Running NiceHash Miner for the first time. Choosing a default language.");
                Application.Run(new Form_ChooseLanguage());
            }

            // Init languages
            International.Initialize(Config.ConfigData.Language);

            if (commandLineArgs.IsLang)
            {
                Helpers.ConsolePrint("NICEHASH", "Language is overwritten by command line parameter (-lang).");
                International.Initialize(commandLineArgs.LangValue);
                Config.ConfigData.Language = commandLineArgs.LangValue;
            }

            Application.Run(new Form_Main(commandLineArgs.IsConfig));
        }