NET FTP Library
UsePassive Property
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : UsePassive Property
If true, use passive FTP mode. The default is passive mode.
Syntax
'Declaration
 
Public Overridable Property UsePassive As System.Boolean
'Usage
 
Dim instance As FTP
Dim value As System.Boolean
 
instance.UsePassive = value
 
value = instance.UsePassive
public virtual System.bool UsePassive {get; set;}
public read-write property UsePassive: System.Boolean; virtual; 
public function get,set UsePassive : System.boolean
public: __property virtual System.bool get_UsePassive();
public: __property virtual void set_UsePassive( 
   System.bool value
);
public:
virtual property System.bool UsePassive {
   System.bool get();
   void set (    System.bool value);
}
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
 
//set to true if you are behind a firewall
ftp.UsePassive = false;
System.Console.WriteLine("{0} FTP is enabled", ftp.UsePassive == true ? "Passive" : "Active");
 
ftp.DownloadFile("a.txt", "a.txt");
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