Exemplo n.º 1
0
        private void DownloadFile(FtpDirectoryInfo file)
        {
            string downloadLocalPath = string.Format("{0}/{1}", this._downloadLocalDirPath, file.FullPath);
            var    args = new FtpDownloadDirectoryChangedEventArgs(this._downloadTotalCount, ++this._downloadCount, file.Name, downloadLocalPath, file.FullPath);

            RaiseDownloadDirectoryChanged(args);

            this._downloadDirectoryChangedAction(file.FullPath, downloadLocalPath, DownloadFileCompleted);
            this._downloadFileIndex++;
        }
Exemplo n.º 2
0
        public FtpDirectory(string responseStr, string dirPath)
            : this()
        {
            this.DirPath = dirPath;
            string[] split = responseStr.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in split)
            {
                var info = FtpDirectoryInfo.Create(line, dirPath);

                if (info != null)
                {
                    if (info.IsDirectory)
                    {
                        this.Directories.Add(info);
                    }
                    else
                    {
                        this.Files.Add(info);
                    }
                }
            }
        }