Xceed .NET Libraries Documentation
FtpConnection Constructor(String,String,String)


Xceed.Ftp Assembly > Xceed.Ftp Namespace > FtpConnection Class > FtpConnection Constructor : FtpConnection Constructor(String,String,String)
The hostname of the FTP server to which to establish a connection.
The username used to connect to the FTP server.
The password used to connect to the FTP server.
Initializes a new instance of the FtpConnection class specifying the HostName of the FTP server, as well as the UserName and Password used to connect.
Syntax
'Declaration
 
Public Function New( _
   ByVal hostName As String, _
   ByVal userName As String, _
   ByVal password As String _
)
'Usage
 
Dim hostName As String
Dim userName As String
Dim password As String
 
Dim instance As New FtpConnection(hostName, userName, password)
public FtpConnection( 
   string hostName,
   string userName,
   string password
)

Parameters

hostName
The hostname of the FTP server to which to establish a connection.
userName
The username used to connect to the FTP server.
password
The password used to connect to the FTP server.
Remarks

The FtpConnection will create connections with the FTP server transparently and as necessary until it is disposed of. To prevent connections with an FTP server from being kept alive, the CloseConnections method can be called. The CloseConnections method will close any connections that are not being used, however the FtpConnection instance will remain usable.

To test if a connection with the specified FTP server is possible before the FtpConnection instance is passed to FtpFile or FtpFolder objects, the TestConnection method can be used. If a connection with an FTP server is not possible, exceptions will be thrown when trying to access properties of the FtpFile and/or FtpFolder instances.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FtpConnection Class
FtpConnection Members
Overload List