private void DeleteFromService() { string pathClient = @"D:\Cursova\DropBox\" + client.login; DirectoryInfo clientInfo = new DirectoryInfo(pathClient); DirectoryInfo serviceInfo = service.GetRootRepository(client); // Synchronizer.SyncFolders(clientInfo, service.GetRootRepository(client)); }
void SyncFunction(string pathClient, TransferServiceClient service, Client client) { while (true) { DirectoryInfo clientInfo = new DirectoryInfo(pathClient); Synchronizer.SyncFolders(clientInfo, service.GetRootRepository(client)); } }
private void Login() { try { service = new TransferServiceClient(); service.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; service.ClientCredentials.UserName.UserName = login; service.ClientCredentials.UserName.Password = password; client = service.GetClient(login); DirectoryInfo rootDir = service.GetRootRepository(client); clientRoot = CheckForFirsSing(rootDir); _controller.CurrentDirectory = clientRoot; OpenDirectory(""); if (sync != null) { try { sync.Abort(); } catch { } } string path = @"D:\Cursova\DropBox\" + client.login; sync = new Thread(() => SyncFunction(path, service, client)); sync.IsBackground = true; sync.Start(); } catch { MessageBox.Show("uncorrect data please try again"); if (!isExit) { AuthenticationApplication app = new AuthenticationApplication(this); app.ShowDialog(); Login(); } else { Application.Exit(); } } }