Exemple #1
0
        static void Main(string[] args)
        {
            var options = new Options();
            
            if (!Parser.Default.ParseArguments(args, options)) return;

            try
            {
                PerformTask(options);
            }
            catch (WebException exception)
            {
                Console.WriteLine(exception.Message);
            }
        }
Exemple #2
0
        private static void PerformTask(Options options)
        {
            using (var client = new WebClient())
            {
                if (options.Snapshot)
                {
                    // TODO KO
//                    Stream stream = client.OpenRead(options.Address);
//                    String request = reader.ReadToEnd();
                }
                else
                {
                    client.UploadFile(options.Address, options.InputFile);
                }
            }
        }