NET SFTP Library
DirectoryExists Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP 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 SFTP
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
SFTP sftp = new SFTP(); //Trial Mode            
//SFTP sftp = new SFTP("place user name here", "place license key here");
 
// set the name of the SFTP server( its URL )
sftp.HostAddress = "some.sftp.server.com";
sftp.UserName = "anonymous"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
 
bool result = sftp.DirectoryExists("/test")
Console.WriteLine("The SFTP directory exists : {0}",result);
Dim sftp As SFTP = New SFTP() 'Trial Mode
'Dim sftp = New SFTP("place user name here", "place license key here")
 
' set the name of the SFTP server( its URL )
sftp.HostAddress = "some.sftp.server.com"
sftp.UserName = "anonymous" ' replace with your user name
sftp.Password = "user@mail.com" ' replace with your password
 
Dim result As Boolean = sftp.DirectoryExists("/test")
Console.WriteLine("The SFTP 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

SFTP Class
SFTP Members