NET SFTP Library
ParentDirectory Property
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class : ParentDirectory Property
Returns the parent directory for the current directory or the root
Syntax
'Declaration
 
Public ReadOnly Property ParentDirectory As System.String
'Usage
 
Dim instance As SFTP
Dim value As System.String
 
value = instance.ParentDirectory
public System.string ParentDirectory {get;}
public read-only property ParentDirectory: System.String; 
public function get ParentDirectory : System.String
public: __property System.string* get_ParentDirectory();
public:
property System.String^ ParentDirectory {
   System.String^ get();
}
Example
SFTP sftp = new SFTP(); //Trial Mode            
//SFTP sftp = new SFTP("place user name here", "place license key here");
 
// set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com"; // replace with your SFTP server
sftp.UserName  = "anonymous"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
 
sftp.CreateDirectory("test");
sftp.CurrentDirectory = "/test";
sftp.CreateDirectory("testSub");
sftp.CurrentDirectory = "/ZTEST/ZTESTSub";
 
Console.WriteLine("The parent directory is {0}",sftp.ParentDirectory);
Dim sftp As SFTP = New SFTP() 'Trial Mode
'Dim sftp As SFTP = New SFTP("place user name here", "place license key here");
 
' set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com" ' replace with your SFTP server
sftp.UserName  = "anonymous" ' replace with your user name
sftp.Password = "user@mail.com" ' replace with your password
 
sftp.CreateDirectory("test")
sftp.CurrentDirectory = "/test"
sftp.CreateDirectory("testSub")
sftp.CurrentDirectory = "/ZTEST/ZTESTSub"
 
Console.WriteLine("The parent directory is {0}",sftp.ParentDirectory)
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