NET FTP Library
OverwriteReadOnlyFiles Property
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : OverwriteReadOnlyFiles Property
If a local file is a read only file it will be overwritten durring a download. The default for this property is false.
Syntax
'Declaration
 
Public Overridable Property OverwriteReadOnlyFiles As System.Boolean
'Usage
 
Dim instance As FTP
Dim value As System.Boolean
 
instance.OverwriteReadOnlyFiles = value
 
value = instance.OverwriteReadOnlyFiles
public virtual System.bool OverwriteReadOnlyFiles {get; set;}
public read-write property OverwriteReadOnlyFiles: System.Boolean; virtual; 
public function get,set OverwriteReadOnlyFiles : System.boolean
public: __property virtual System.bool get_OverwriteReadOnlyFiles();
public: __property virtual void set_OverwriteReadOnlyFiles( 
   System.bool value
);
public:
virtual property System.bool OverwriteReadOnlyFiles {
   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
 
//If a local file is a read only file it will be overwritten durring a download 
ftp.OverwriteReadOnlyFiles = false;
System.Console.WriteLine("A readonly file that already exist will {0} durring a download ", ftp.OverwriteReadOnlyFiles == true ? "be overwritten" : "not be overwritten");
 
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
 
'If a local file is a read only file it will be overwritten durring a download 
ftp.OverwriteReadOnlyFiles = False
If ftp.OverwriteReadOnlyFiles = True Then
    System.Console.WriteLine("A readonly file that already exist will {0} durring a download ","be overwritten")
Else
    System.Console.WriteLine("A readonly file that already exist will {0} durring a download ","not be overwritten")
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