Пример #1
0
        static void Main(string[] args)
        {
            Ftp A = new Ftp();

            try {
                if (args.Length == 2)
                {
                    A.Resolve(args[0], args[1]);
                }
                else
                {
                    A.Resolve(args[0], args[1], args[2]);
                }
                A.Run();
            }
            catch (IndexOutOfRangeException) {
                Console.WriteLine("Niepoprawna składnia. Spróbuj: Ftp <user>@<adres_ftp>/<katalog> <cel> [-level]");
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Console.ReadKey();
            }

            Console.WriteLine("Gotowe.");
        }
Пример #2
0
 static int Main(string[] args)
 {
     try
     {
         if(args.Length==1)
         {
             args=new string[] { args[0],""};
         }
         if (args.Length == 0)
         {
             args = new string[2];
             args[0]="C:\\Program Files (x86)\\CruiseControl.NET\\server\\Release\\dev\\TrueSky-2.9.6.0.chm";
             args[1]="dev\\";
         }
         Ftp ftpClient=new Ftp(@"ftp://ftp.simul.co","*****@*****.**","7}Rt]~0t9_bN");
         ftpClient.upload(args[0], args[1]);
     }
     catch (Exception e)
     {
         System.Console.WriteLine(e.Message);
         return 1;
     }
     return 0;
 }