public Form1() { InitializeComponent(); //hiders**************************8 //sender HideEverything(); Clock = new Timer(); Clock.Interval = 500; RecievingBar.Maximum = 100; RecievingBar.Minimum = 0; SendingBar.Maximum = 100; SendingBar.Minimum = 0; controller = new Controller("224.1.1.1", 9001); Starting(); }
public static void SendFileInfo(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); control.SendFileInfo(); } }
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()); } } }
public static void ReceiveFileInfo() { Controller control = new Controller(ip, port); Console.WriteLine("Receiving file info..."); while(true){ Thread.Sleep(2000); control.UpdateFilesAvailable(); List<List<string>> files = control.GetFilesAvailable(); foreach(List<string> info in files){ string temp = info[0] + " / " + info[1] + " / " + info[2]; Console.WriteLine(temp); } } }
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()); } } }