예제 #1
0
        static int Main(string[] args)
        {
            var client   = NitroClient.FromJson();
            var progress = new ConsoleProgress();

            var key = client.GetKeyInfo();

            if (key is null)
            {
                Console.Error.WriteLine("Can't get key");
                return(1);
            }

            if (!key.IsActive())
            {
                Console.Error.WriteLine("Key is not active");
                return(1);
            }

            Console.WriteLine($"Today traffic left: {(key.TrafficLeft / 1024 / 1024):N0} Mb");

            if (args.Length != 0)
            {
                foreach (var url in args)
                {
                    client.DownloadFile(url, progress);
                }

                Console.WriteLine();
                Console.WriteLine("ALL DONE");
                Console.WriteLine();
            }

            return(0);
        }
예제 #2
0
파일: MainForm.cs 프로젝트: amironov73/misc
        public MainForm()
        {
            InitializeComponent();

            _client = NitroClient.FromJson();
        }