NET FTP Library
DirectoryExists Method
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : DirectoryExists Method
Check to see if an FTP directory exists.
Syntax
'Declaration
 
Public Function DirectoryExists( _
   ByVal directory As System.String _
) As System.Boolean
'Usage
 
Dim instance As FTP
Dim directory As System.String
Dim value As System.Boolean
 
value = instance.DirectoryExists(directory)
public System.bool DirectoryExists( 
   System.string directory
)
public function DirectoryExists( 
    directory: System.String
): System.Boolean; 
public function DirectoryExists( 
   directory : System.String
) : System.boolean;
public: System.bool DirectoryExists( 
   System.string* directory
) 
public:
System.bool DirectoryExists( 
   System.String^ directory
) 

Parameters

directory
Example
FTP ftp = new FTP(); //Trial Mode            
//FTP ftp = new FTP("place user name here", "place license key here");
 
// set the name of the FTP server( its URL )
ftp.HostAddress = "ftp.fsz.bme.hu"; // a hungarian university. change this to your ftp server
ftp.UserName = "anonymous"; // replace with your user name
ftp.Password = "user@mail.com"; // replace with your password
 
bool result = ftp.DirectoryExists("/test")
Console.WriteLine("The FTP directory exists : {0}",result);
Dim ftp As FTP = New FTP() 'Trial Mode
'FTP ftp = new FTP("place user name here", "place license key here");
 
' set the name of the FTP server( its URL )
ftp.HostAddress = "ftp.fsz.bme.hu" ' a hungarian university. change this to your ftp server
ftp.UserName = "anonymous" ' replace with your user name
ftp.Password = "user@mail.com" ' replace with your password
 
Dim result As Boolean = ftp.DirectoryExists("/test")
Console.WriteLine("The FTP directory exists : {0}",result)
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

FTP Class
FTP Members