ZennoLab Assemblies Documentation
FtpChmode Method (ZennoPoster)
Example 

Type: System.String

The address of the FTP server.

Type: System.Int32

The port of the FTP server.

Type: System.String

The FTP protocol. It can be "FTP", "sFTP", or "FTPs".

Type: System.String

The login of the FTP server.

Type: System.String

The password of the FTP server.

Type: System.String

The proxy string in format: login:pass@ip:port OR ip:port.

Type: System.String

The path of ftp item.

Type: System.String

The mode for specified item. This a string value can be empty, in this case the mode of item will be "000".

Changes the access mode of specified ftp item.
Syntax
public static void FtpChmode( 
   string host,
   int port,
   string protocol,
   string login,
   string pass,
   string proxy,
   string serverPath,
   string mode
)

Parameters

host

Type: System.String

The address of the FTP server.
port

Type: System.Int32

The port of the FTP server.

protocol

Type: System.String

The FTP protocol. It can be "FTP", "sFTP", or "FTPs".

login

Type: System.String

The login of the FTP server.

pass

Type: System.String

The password of the FTP server.

proxy

Type: System.String

The proxy string in format: login:pass@ip:port OR ip:port.

serverPath

Type: System.String

The path of ftp item.

mode

Type: System.String

The mode for specified item. This a string value can be empty, in this case the mode of item will be "000".

Remarks

For changing mode on ftp server you should make sure that current server support the "SITE CHMOD" command otherwise, this operation can not be performed.

The specified item can be file or directory. In case if specified item is the directory, the mode will be changed only for this ftp item, all internal files and subdirectories will not change the mode.

Example
The following example shows call the FtpChmode method.
// change mode for file located on path MyFolder\MyTXTFile.txt
ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MyTXTFile.txt", "774");
// change mode for directory located on path MyFolder\MySubFolder
ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MySubFolder", "755");
// change mode for file located on path MyFolder\MyTXTFile.txt
ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MyTXTFile.txt", "774");
// change mode for directory located on path MyFolder\MySubFolder
ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MySubFolder", "755");
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

ZennoPoster Class
ZennoPoster Members
FtpCreateDirectory Method
FtpDeleteDirectory Method
FtpDeleteFile Method
FtpDownload Method
FtpGetList Method
FtpUploadDirectory Method
FtpUploadFile Method

Send Feedback