Ejemplo n.º 1
0
 public FTPClient()
 {
     this.dirEmptyStrings = new DirectoryEmptyStrings();
     this.transferCompleteStrings = new TransferCompleteStrings();
     this.fileNotFoundStrings = new FileNotFoundStrings();
     this.modtimeFormats = new string[] { "yyyyMMddHHmmss", "yyyyMMddHHmmss'.'f", "yyyyMMddHHmmss'.'ff", "yyyyMMddHHmmss'.'fff" };
     this.control = null;
     this.data = null;
     this.timeout = 0x1d4c0;
     this.noOperationInterval = 0;
     this.strictReturnCodes = false;
     this.cancelTransfer = false;
     this.transferNotifyListings = false;
     this.resume = false;
     this.deleteOnFailure = true;
     this.mdtmSupported = true;
     this.sizeSupported = true;
     this.resumeMarker = 0L;
     this.showHiddenFiles = false;
     this.monitorInterval = 0x1000L;
     this.transferBufferSize = 0x1000;
     this.parserCulture = CultureInfo.InvariantCulture;
     this.fileFactory = new EnterpriseDT.Net.Ftp.FTPFileFactory();
     this.transferType = FTPTransferType.ASCII;
     this.connectMode = FTPConnectMode.PASV;
     this.synchronizePassiveConnections = false;
     this.activePortRange = new PortRange();
     this.activeIPAddress = null;
     this.controlPort = -1;
     this.remoteHost = null;
     this.autoPassiveIPSubstitution = false;
     this.closeStreamsAfterTransfer = true;
     this.controlEncoding = null;
     this.dataEncoding = null;
     this.throttler = null;
     this.InitBlock();
 }
Ejemplo n.º 2
0
 public virtual FTPFile[] DirDetails(string dirname)
 {
     if (this.fileFactory == null)
     {
         this.fileFactory = new EnterpriseDT.Net.Ftp.FTPFileFactory();
     }
     if (!this.fileFactory.ParserSetExplicitly && (this.fileFactory.System == null))
     {
         try
         {
             this.fileFactory.System = this.GetSystem();
         }
         catch (FTPException exception)
         {
             this.log.Warn("SYST command failed - setting Unix as default parser", exception);
             this.fileFactory.System = "UNIX";
         }
     }
     if (this.parserCulture != null)
     {
         this.fileFactory.ParsingCulture = this.parserCulture;
     }
     string str = this.Pwd();
     if (((dirname != null) && (dirname.Length > 0)) && ((dirname.IndexOf('*') < 0) && (dirname.IndexOf('?') < 0)))
     {
         str = Path.Combine(str, dirname);
     }
     FTPFile[] fileArray = this.fileFactory.Parse(this.Dir(dirname, true));
     for (int i = 0; i < fileArray.Length; i++)
     {
         fileArray[i].Path = str + (str.EndsWith("/") ? "" : "/") + fileArray[i].Name;
     }
     return fileArray;
 }