Esempio n. 1
0
        static void Main()
        {
            AppCore.Core     = new AppCore();
            SubmissionsDB.DB = new SubmissionsDB();
            GlobalSettings.GlobalSettingsInit();

            var args = Environment.GetCommandLineArgs();

            if (args.Count() < 2 || args[1] != "-b")
            {
                if (args.Count() >= 2)
                {
                    Console.WriteLine("Note: found some invalid command line arguments");
                    Console.WriteLine("For CLI usage notes run this app with -b -help");
                }
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                WebBrowserEmulationSet();
                Utils.EmbeddedIeUtils.SetKnownUserAgent();
                Application.Run(new authForm());
            }
            else
            {
                bool AuthRes = AppCore.Core.Init().Result;
                if (!AuthRes)
                {
                    Console.WriteLine("Not authorized! Log in at least once using GUI first.");
                    Console.WriteLine("Alternatively, provide the 'cookie' and 'user-agent' header values");
                    Console.WriteLine("via FURDOWN_COOKIES and FURDOWN_USERAGENT environment variables.");
                    return;
                }
                CommandLineInterface.Execute(args).Wait();
            }
            AppCore.Core.OnAppTerminate();
        }
Esempio n. 2
0
        static void Main()
        {
            AppCore.Core     = new AppCore();
            SubmissionsDB.DB = new SubmissionsDB();
            GlobalSettings.GlobalSettingsInit();

            var args = Environment.GetCommandLineArgs();

            if (args.Count() < 2 || args[1] != "-b")
            {
                if (args.Count() >= 2)
                {
                    Console.WriteLine("Note: found some invalid command line arguments");
                    Console.WriteLine("For CLI usage notes run this app with -b -help");
                }
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                WebBrowserEmulationSet();
                Application.Run(new authForm());
            }
            else
            {
                bool AuthRes = AppCore.Core.Init().Result;
                if (!AuthRes)
                {
                    Console.WriteLine("Not authorized! Log in at least once using GUI first.");
                    return;
                }
                CommandLineInterface.Execute(args).Wait();
            }
            AppCore.Core.OnAppTerminate();
        }