NET FTP Library
UseBinary Property
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : UseBinary Property
If true, use binary transfer mode else use ascii mode. The default mode is binary.
Syntax
'Declaration
 
Public Overridable Property UseBinary As System.Boolean
'Usage
 
Dim instance As FTP
Dim value As System.Boolean
 
instance.UseBinary = value
 
value = instance.UseBinary
public virtual System.bool UseBinary {get; set;}
public read-write property UseBinary: System.Boolean; virtual; 
public function get,set UseBinary : System.boolean
public: __property virtual System.bool get_UseBinary();
public: __property virtual void set_UseBinary( 
   System.bool value
);
public:
virtual property System.bool UseBinary {
   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 the transfer type:  binary transfer mode or text mode 
ftp.UseBinary = true;
System.Console.WriteLine("Current transfer type is is {0}", ftp.UseBinary == true ? "binary" : "text");
 
ftp.DownloadFile("a.txt", "a.txt");
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
 
' set the transfer type:  binary transfer mode or text mode 
ftp.UseBinary = True
If ftp.UseBinary = True Then
    System.Console.WriteLine("Current transfer type is is {0}","binary")
Else
    System.Console.WriteLine("Current transfer type is is {0}","text")
End If
 
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