Esempio n. 1
0
 private void button17_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBox14.Text == string.Empty)
         {
             MessageBox.Show("Please specify user name for the operations");
             return;
         }
         if (checkBox5.Checked == true)
         {
             if (Directory.Exists(textBox13.Text) == false)
             {
                 MessageBox.Show("Wrong directory to sync is not set");
                 return;
             }
             int        count = 0;
             FileData[] files = FastDirectoryEnumerator.GetFiles(textBox2.Text,
                                                                 "*.wrong",
                                                                 checkBox4.Checked == true ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
             for (int i = 0; i < files.Length; i++)
             {
                 try
                 {
                     File.Move(files[i].Path, textBox12.Text + "\\" + files[i].Name);
                     count++;
                 }
                 catch (Exception exx)
                 {
                     MessageBox.Show(exx.Message);
                 }
             }
             MessageBox.Show("Total wrong files moved to " + textBox12.Text + " are " + count);
         }
         int res = m_client.SyncFilesWithDataBase(textBox13.Text, checkBox4.Checked, textBox14.Text, 0);
         if (res == 0)
         {
             MessageBox.Show("Sync files is in progress");
         }
         else
         {
             while (m_syncFileEnded == false)
             {
                 Thread.Sleep(500);
             }
             m_syncFileEnded = false;
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }