public void SendFile(string filename)
        {
            if (transferClient == null)
            {
                return;
            }

            transferClient.QueueTransfer(filename);
        }
        private void btnSendFile_Click(object sender, EventArgs e)
        {
            if (transferClient == null)
            {
                return;
            }
            //Get the user desired files to send


            //  if (o.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            if (MessageBox.Show("即将传送文件:\n" + filePath1 + '\n' + filePath2 + "\n是否继续?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                //foreach (string file in filesPath)
                //{
                transferClient.QueueTransfer(filePath1);
                transferClient.QueueTransfer(filePath2);
            }
            else
            {
                this.Close();
                this.DialogResult = DialogResult.No;
            }
        }
Ejemplo n.º 3
0
    private void btnSendFile_Click(object sender, EventArgs e)
    {
        if (transferClient == null)
        {
            return;
        }
        using (OpenFileDialog o = new OpenFileDialog())
        {
            o.Filter      = "All Files(*.*)|*.*";
            o.Multiselect = true;

            if (o.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                foreach (string file in o.FileNames)
                {
                    transferClient.QueueTransfer(file);
                }
            }
        }
    } //Open and send file using queue
Ejemplo n.º 4
0
        private void ExecuteSendFile()
        {
            if (transferClient == null)
            {
                return;
            }

            using (WinForms.OpenFileDialog ofd = new WinForms.OpenFileDialog())
            {
                ofd.Filter      = "All Files (*.*)|*.*";
                ofd.Multiselect = true;

                if (ofd.ShowDialog() == WinForms.DialogResult.OK)
                {
                    foreach (var file in ofd.FileNames)
                    {
                        transferClient.QueueTransfer(file);
                    }
                }
            }
        }
Ejemplo n.º 5
0
    private void btnSendFile_Click(object sender, EventArgs e)
    {
        if (transferClient == null)
        {
            return;
        }
        //Get the user desired files to send
        using (OpenFileDialog o = new OpenFileDialog())
        {
            o.Filter      = "All Files (*.*)|*.*";
            o.Multiselect = true;

            if (o.ShowDialog() == DialogResult.OK)
            {
                foreach (string file in o.FileNames)
                {
                    transferClient.QueueTransfer(file);
                }
            }
        }
    }