Exemplo n.º 1
0
        private void DownloadButton_Click(object sender, EventArgs e)
        {
            Transfer.XModem xModem = new Transfer.XModem();
            string          fn     = Path.ChangeExtension(Path.GetTempFileName(), ".xmodem");

            Crt.PrintLine("Receiving to " + fn);
            xModem.ReceiveFile(Session, fn);
        }
Exemplo n.º 2
0
        private void XModem_Send_Click(object sender, EventArgs e)
        {
            OpenFileDialog f = new OpenFileDialog();

            f.InitialDirectory = Session.DownloadDirectory;
            if (f.ShowDialog() == DialogResult.OK)
            {
                Session.DownloadDirectory = System.IO.Path.GetDirectoryName(f.FileName);

                Transfer.ITransferProtocol t = new Transfer.XModem();
                t.TransferControl = transferControl1;
                Session.Transfer  = t;
                t.SendFile(Session, f.FileName);
            }
        }
Exemplo n.º 3
0
        private void XModem_Receive_Click(object sender, EventArgs e)
        {
            SaveFileDialog f = new SaveFileDialog();

            f.InitialDirectory = Session.DownloadDirectory;
            if (f.ShowDialog() == DialogResult.OK)
            {
                Session.DownloadDirectory = System.IO.Path.GetDirectoryName(f.FileName);

                Crt.PrintSeparater();
                Crt.PrintLine("\r  Downloading " + f.FileName);

                Transfer.ITransferProtocol t = new Transfer.XModem();
                Session.Transfer = t;
                t.ReceiveFile(Session, f.FileName);
            }
        }