Example #1
0
        private void BtnSendFile_Click(object sender, EventArgs e)
        {
            string source, destination;

            source      = txtSourceFile.Text;
            destination = txtFileDestination.Text;

            var id = GetID();

            if (string.IsNullOrEmpty(source))
            {
                throw new Exception("Source cannot be empty.");
            }
            if (string.IsNullOrEmpty(destination))
            {
                throw new Exception("Destination cannot be empty.");
            }

            try
            {
                _listener.SendFile(id, source, destination, false);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }