Exemple #1
0
 /// <summary>
 /// Constructor. Creates the control socket
 /// </summary>
 /// <param name="remoteAddr">
 /// the address of the remote host
 /// </param>
 /// <param name="log">
 /// log stream for logging to
 /// </param>
 /// <param name="timeout">
 /// the length of the timeout, in seconds
 /// </param>
 public Ftp(IPAddress remoteAddress, StreamWriter log, int timeout)
 {
     control = new ControlSocket(
         remoteAddress,
         ControlSocket.ControlPort,
         log,
         timeout);
 }
Exemple #2
0
 /// <summary>
 /// Quit the FTP session
 /// </summary>
 public void Quit()
 {
     try
     {
         var reply      = control.SendCommand("QUIT");
         var validCodes = new string[] { "221", "226" };
         lastValidReply = control.ValidateReply(reply, validCodes);
     }
     finally
     {
         // ensure we clean up the connection
         control.Logout();
         control = null;
     }
 }
Exemple #3
0
 /// <summary>
 /// Constructor. Creates the control socket
 /// </summary>
 /// <param name="remoteHost">
 /// the remote hostname
 /// </param>
 /// <param name="controlPort">
 /// port for control stream
 /// </param>
 /// <param name="log">
 /// log stream for logging to
 /// </param>
 /// <param name="timeout">
 /// the length of the timeout, in milliseconds
 /// </param>
 public Ftp(string remoteHost, int controlPort, StreamWriter log, int timeout)
 {
     control = new ControlSocket(remoteHost, controlPort, log, timeout);
 }
Exemple #4
0
 /// <summary>
 /// Constructor. Creates the control
 /// socket. Allows setting of control port ( normally
 /// set by default to 21 ).
 /// </summary>
 /// <param name="remoteAddr"> the address of the
 /// remote host
 /// </param>
 /// <param name="controlPort"> port for control stream
 ///
 /// </param>
 public Ftp(IPAddress remoteAddress, int controlPort)
 {
     control = new ControlSocket(remoteAddress, controlPort, null, 0);
 }
Exemple #5
0
 /// <summary>
 /// Constructor. Creates the control socket
 /// </summary>
 /// <param name="remoteAddr"> the address of the
 /// remote host
 ///
 /// </param>
 public Ftp(IPAddress remoteAddress)
 {
     control = new ControlSocket(remoteAddress, ControlSocket.ControlPort, null, 0);
 }
Exemple #6
0
 /// <summary>
 /// Constructor. Creates the control socket
 /// </summary>
 /// <param name="remoteHost">
 /// the remote hostname
 /// </param>
 public Ftp(string remoteHost)
 {
     control = new ControlSocket(remoteHost, ControlSocket.ControlPort, null, 0);
 }