예제 #1
0
        private static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.Error.WriteLine("Usage: <<Program>> {-s|-d} ip-address-of-source");
                Environment.Exit(1);
            }
            Console.WriteLine(CopyRight);
            var mesg = "Starting {0} in current directory: " + DirectoryCheck.GetCurrentDirectoryName();

            switch (args[0])
            {
            case "-s":
                Console.WriteLine(mesg, "source");
                new SourceFolder(args[1]).Start();
                break;

            case "-d":
                Console.WriteLine(mesg, "destination");
                new DestinationFolder(args[1]).Start();
                break;

            default:
                Console.Error.WriteLine("The first parameter should '-s' for source or '-d' for destination");
                break;
            }
        }
예제 #2
0
 private void StartTranfer()
 {
     if (!DirectoryCheck.AreDirectoryNamesMatching(_stream))
     {
         return;
     }
     SyncFolders();
     SyncFiles();
 }
예제 #3
0
 private void TransferInfo()
 {
     if (!DirectoryCheck.AreDirectoryNamesMatching(_stream))
     {
         Transfer.Receive(_stream); //Wait for EndConnection message
         return;
     }
     SendFolderNames();
     SendFileNames();
     SendSpecificFileContents();
 }