示例#1
0
        public static void SendFile(string file)
        {
            FileInfo fi = new FileInfo(file);
            if (!fi.Exists){
                Console.WriteLine("File doesn't exist");
                return;
            }

            Controller control = new Controller(ip, port);
            control.SetReadFile(file);

            Console.WriteLine("Sending File info...");
            while(true){
                Thread.Sleep(250);
                if (control.SendChecker()){
                    Console.WriteLine("Done Sending");
                }else{
                    Console.WriteLine("Sending: " + control.GetPercent());
                }
            }
        }
示例#2
0
        public static void ReceiveFile(string file)
        {
            FileInfo fi = new FileInfo(file);
            if (fi.Exists){
                Console.WriteLine("File exists! Overwriting.");
                // TODO: Make it ask
            }

            Controller control = new Controller(ip, port);
            control.SetWriteFile(file, 95000);
            while(true){
                Thread.Sleep(250);
                if (control.ReceiveChecker()){
                    Console.WriteLine("Done Receiving");
                    break;
                }else{
                    Console.WriteLine("Receiving: " + control.GetPercent());
                }
            }
        }