Exemplo n.º 1
0
////////////////////////////////////////////////////////////////////////////////
///////////// кнопки управления файлами ////////////////////////////////////////

        private void btnSend_Click(object sender, EventArgs e)
        {
            if ((NetThrd != null) &&
                (NetThrd.ThreadState == ThreadState.Stopped))
            {
                NetThrd = null;
            }

            if (NetThrd == null)
            {
                FrmWait frmWait = new FrmWait();

                if (TrData.Login.Length != 0)
                {
                    openFileDlg.ShowDialog();

                    if (openFileDlg.FileName != "")
                    {
                        NetThrd = new Thread(new ParameterizedThreadStart(ThrdSendFile));
                        NetThrd.Start(frmWait);
                        frmWait.Start();

                        ReloadLists();
                    }
                }
                else
                {
                    MessageBox.Show("Введите логин и нажмите кнопку Вход");
                }
            }
        }
Exemplo n.º 2
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            if ((NetThrd != null) &&
                (NetThrd.ThreadState == ThreadState.Stopped))
            {
                NetThrd = null;
            }

            if (NetThrd == null)
            {
                FrmWait frmWait = new FrmWait();

                if (TrData.Login.Length != 0)
                {
                    string servname;    //сюда поместим имя файла, как он зовётся на сервере
                    if (listFileUser.SelectedIndex != -1)
                    {
                        servname = listFileUser.GetItemText(listFileUser.SelectedItem);
                    }
                    else if (listFileAll.SelectedIndex != -1)
                    {
                        servname = listFileAll.GetItemText(listFileAll.SelectedItem);
                    }
                    else
                    {
                        MessageBox.Show("Выберите файл");
                        return;
                    }

                    saveFileDlg.ShowDialog();

                    if (saveFileDlg.FileName != "")
                    {
                        NetThrd = new Thread(new ParameterizedThreadStart(ThrdLoadFile));
                        object[] parms = new object[3];
                        parms[0] = frmWait;
                        parms[1] = servname;
                        parms[2] = saveFileDlg.FileName;
                        NetThrd.Start(parms);
                        frmWait.Start();
                        saveFileDlg.FileName = "";
                    }
                }
                else
                {
                    MessageBox.Show("Введите логин и нажмите кнопку Вход");
                }
            }
        }
Exemplo n.º 3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if ((NetThrd != null) &&
                (NetThrd.ThreadState == ThreadState.Stopped))
            {
                NetThrd = null;
            }

            if (NetThrd == null)
            {
                FrmWait frmWait = new FrmWait();
                NetThrd = new Thread(new ParameterizedThreadStart(ThrdDelete));
                NetThrd.Start(frmWait);
                frmWait.Start();
                ReloadLists();
            }
        }