NET FTP Library
ParentDirectory Property
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : ParentDirectory Property
Returns the parent directory for the current directory or the root
Syntax
'Declaration
 
Public Overridable ReadOnly Property ParentDirectory As System.String
'Usage
 
Dim instance As FTP
Dim value As System.String
 
value = instance.ParentDirectory
public virtual System.string ParentDirectory {get;}
public read-only property ParentDirectory: System.String; virtual; 
public function get ParentDirectory : System.String
public: __property virtual System.string* get_ParentDirectory();
public:
virtual property System.String^ ParentDirectory {
   System.String^ get();
}
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
 
ftp.CreateDirectory("test");
ftp.CurrentDirectory = "/test";
ftp.CreateDirectory("testSub");
ftp.CurrentDirectory = "/ZTest/ZTestSub";
 
Console.WriteLine("The parent directory is {0}",ftp.ParentDirectory);
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
 
ftp.CreateDirectory("test")
ftp.CurrentDirectory = "/test"
ftp.CreateDirectory("testSub")
ftp.CurrentDirectory = "/ZTest/ZTestSub"
 
Console.WriteLine("The parent directory is {0}",ftp.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

FTP Class
FTP Members