Пример #1
0
        public new void Load(ServersTreeNodes.RemoteFileNode node, Tabs tabs)
        {
            ftp     = true;
            Data    = node.data;
            ftpFile = node.GetFile();
            FtpDownloader downloader       = new FtpDownloader();
            string        ftpIp            = node.data.adress.Replace("/", "").Split(':')[1];
            string        ftpLocalFileName = Main.TempRemoteDirectory + ftpIp + Path.DirectorySeparatorChar + Path.GetFileName(node.GetFile());

            downloader.Download(node.data, ftpLocalFileName, node.GetFile());
            Load(new FileInfo(ftpLocalFileName), tabs);
        }
Пример #2
0
        public new void Load(Data.RemoteServer _data, string file, Tabs tabs)
        {
            ftp     = true;
            Data    = _data;
            ftpFile = file;
            FtpDownloader downloader       = new FtpDownloader();
            string        ftpIp            = this.Data.adress.Replace("/", "").Split(':')[1];
            string        ftpLocalFileName = Main.TempRemoteDirectory + ftpIp + Path.DirectorySeparatorChar + Path.GetFileName(file);

            downloader.Download(Data, ftpLocalFileName, file);
            Load(new FileInfo(ftpLocalFileName), tabs);
        }
Пример #3
0
        public void DownloadTest()
        {
            string uri      = @"ftp://www.pilotvision.co.jp/googlehostedservice.html";
            string userName = "******";
            string password = "******";

            FtpDownloader target = new FtpDownloader(userName, password);

            MemoryStream actual = null;

            actual = target.Download(uri);
            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.Length > 0);
        }