GSF.Net.Ftp.FtpClient.Connect C# (CSharp) Method

Connect() public method

Connects to FTP server using specified credentials.
public Connect ( string userName, string password ) : void
userName string User name used to authenticate to FTP server.
password string Password used to authenticate to FTP server.
return void
        public void Connect(string userName, string password)
        {
            m_currentState.Connect(userName, password);
        }

Usage Example

Example #1
0
        /// <summary>
        /// Clones FTP session used by file watcher so it can be used for other purposes.
        /// </summary>
        /// <returns>New connected FTP session matching settings defined for FTP file watcher.</returns>
        public virtual FtpClient CloneFtpSession()
        {
            // This method is just for convenience.  We can't allow the end user to use the
            // actual internal directory for sending files or other work because it is
            // constantly being refreshed/used etc., so we instead create a new FTP Session
            // based on the current internal session and watch directory information
            FtpClient newSession = new FtpClient(m_session.CaseInsensitive);

            newSession.Server = m_session.Server;
            newSession.Connect(m_username, m_password);
            newSession.SetCurrentDirectory(m_watchDirectory);

            return newSession;
        }
All Usage Examples Of GSF.Net.Ftp.FtpClient::Connect