Esempio n. 1
0
        private void m_btnDownloadMem_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (m_sLastFile.Length == 0)
            {
                return;
            }

            if (m_bLastFileIsFolder)
            {
                return;
            }

            if (m_lLastFileSize < 0)
            {
                return;
            }

            if (m_ftpc.WorkingDirectory.Length == 0)
            {
                return;
            }

            string sPath = m_ftpc.WorkingDirectory;

            sPath += m_sLastFile;

            RscFtpClientCommand cmd = RscFtpClientCommand.DownloadBin(sPath, m_lLastFileSize);

            _SendAutoPASV(cmd);
        }
Esempio n. 2
0
        private void m_btnDownloadFile_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (m_sLastFile.Length == 0)
            {
                return;
            }

            if (m_bLastFileIsFolder)
            {
                return;
            }

            if (m_lLastFileSize < 0)
            {
                return;
            }

            if (m_ftpc.WorkingDirectory.Length == 0)
            {
                return;
            }

            string sPath = m_ftpc.WorkingDirectory;

            sPath += m_sLastFile;

            RscStore store = new RscStore();

            string sLocalPath = "A:\\FTP";

            if (!store.FolderExists(sLocalPath))
            {
                store.CreateFolder(sLocalPath);
            }
            sLocalPath += "\\" + m_sLastFile;
            if (store.FileExists(sLocalPath))
            {
                store.DeleteFile(sLocalPath);
            }
            System.IO.Stream stream = store.CreateFile(sLocalPath);

            RscFtpClientCommand cmd = RscFtpClientCommand.DownloadBin(sPath, m_lLastFileSize, "", null, stream);

            _SendAutoPASV(cmd);
        }