private void bt_download_Click(object sender, EventArgs e)
 {
     try
     {
         Thread processThread = new Thread(ServerKoppeling.requestFile);
         processThread.Start(file_selection.Pad);
         Loadingform loadingform = new Loadingform(processThread);
         loadingform.ShowDialog();
         ServerKoppeling.requestFile(file_selection.Pad);
         DatabaseKoppeling.downloadsOneUp(file_selection.Bestand_id);
         file_selection.DownloadsOneUp();
         lb_aantaldownloadsvar.Text = file_selection.Gedownload.ToString();
     }
     catch
     {
         MessageBox.Show("Ongeldige actie. \nEr heeft zich een restrictie voorgedaan of de connectie is verbroken.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #2
0
        private void bt_accept_Click(object sender, EventArgs e)
        {
            try
            {
                if (info != null)
                {
                    this.Visible = false;

                    ThreadStart ts = delegate() { ServerKoppeling.sendFile(info.FullName, parent.folder_selection.FullPath); };
                    Thread t = new Thread(ts);
                    t.Start();
                    Loadingform loadingform = new Loadingform(t);
                    loadingform.ShowDialog();
                    parent.listv_files.Items.Add(DatabaseKoppeling.newFile(parent.folder_selection.Map_id, tb_beschrijving.Text, info.Length, parent.RFID, parent.folder_selection.FullPath + "\\" + info.Name));
                    this.Close();
                }
            }
            catch
            {
                MessageBox.Show("Ongeldige actie. \nEr heeft zich een restrictie voorgedaan of de connectie is verbroken.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }