| C# | |
|---|---|
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".
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.
| C# | Copy Code |
|---|---|
// 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"); | |
| PHP | Copy Code |
|---|---|
// 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"); | |
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family