Пример #1
0
        private void DoNetSend()
        {
            if (fileName == null)
            {
                MessageBox.Show("请先选择要下载的文件", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            IPAddress ip;

            try
            {
                ip = IPAddress.Parse(txtIP.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("IP地址设置有误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtIP.Focus();
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Application.DoEvents();
            载.Enabled = false;
            try
            {
                TFTPClient tftp = new TFTPClient(txtIP.Text);
                tftp.Put("Coin.bin", fileName);
                //MessageBox.Show("PUT finished");
            }
            catch (TFTPClient.TFTPException tx)
            {
                MessageBox.Show("Exception in PUT: " + tx.ErrorMessage);
                Cursor.Current = Cursors.Default;
            }
            载.Enabled      = true;
            Cursor.Current = Cursors.Default;
            Application.DoEvents();
        }
Пример #2
0
 public void TestPutCoarseWrapper()
 {
     client.Put(remotePath, localPath);
     FileAssert.AreEqual(localPath, serverPath + remotePath);
 }
Пример #3
0
 public static void PutCoarseWrapper()
 {
     clnt.Put(remotePutPath, localPutPath);
 }