C# FluentFTP v46.0.2 文档二

目录

概述

File Permissions 文件权限

GetChmod()

GetFilePermissions()

Chmod()

SetFilePermissions()

File Hashing 文件哈希

HashAlgorithms

GetHash()

GetHashAlgorithm()

SetHashAlgorithm()

GetChecksum()

GetMD5()

GetXMD5()

GetXSHA1()

GetXSHA256()

GetXSHA512()

GetXCRC()

FTPS 文件传输协议

EncryptionMode

DataConnectionEncryption

SslProtocols 

ClientCertificates

ValidateCertificate

Advanced Settings 高级设置

GetDataType()

SetDataType()

DataConnectionType

UngracefullDisconnection

Encoding

InternetProtocolVersions

ActivePorts

SocketPollInterval

ConnectTimeout

ReadTimeout

DataConnectionConnectTimeout

DataConnectionReadTimeout

SocketKeepAlive

StaleDataCheck

TransferChunkSize

MaximumDereferenceCount

EnableThreadSafeDataConnections

IsClone

结束


概述

FluentFTP是一个完全管理的FTP客户端,它被设计为易于使用和易于扩展。它支持文件和目录列表,上传和下载文件以及SSL/TLS连接。它可以连接到基于Unix和Windows/IIS的FTP服务器。这个项目完全是用托管的C#开发的。所有的功劳都归于J.P. Trosclair,他开发并维护这个库直到2016年。FluentFTP是在MIT许可下发布的,所以它既可以用于专有的也可以用于自由/开源的应用程序。

功能特点
• 完全支持FTP、FTPS(FTP over SSL)和带客户证书的FTPS
• 所有主要服务器类型(UNIX、IIS、DOS等)的文件和目录列表
• 轻松地从服务器上传和下载一个文件
• 使用标准流轻松地从服务器上读取和写入文件数据
• 创建、追加、读取、写入、重命名和删除文件和文件夹
• 递归地删除文件夹及其所有内容
• 获取文件/文件夹信息(存在、大小、安全标志、修改日期/时间)。
• 获取和设置文件权限(所有者、组、其他)。
• 绝对或相对路径(相对于 "工作目录")。
• 获取文件的哈希值/校验值(SHA-1、SHA-256、SHA-512和MD5)。
• 支持DrFTPD的PRET命令
• 支持FTP代理(User@Host, HTTP 1.1)。
• 支持SITE CHMOD命令(仅限Unix)。
• 解除符号链接的引用
• 被动和主动的数据连接(PASV, EPSV, PORT 和 EPRT)
• 所有操作的同步和异步方法(IAsyncResult模式)。
• 使用.NET的SSLStream为控制和数据连接支持显式和隐式SSL连接
• 通过为文件传输克隆FTP控制连接来提高线程安全(可选)。
• 实施自己的内部锁定,以努力保持事务的同步性
• 当服务器支持时,包括对非标准的散列/校验命令的支持
• 使用Execute()方法轻松地发布任何不支持的FTP命令,但需要数据连接的命令除外(文件列表和传输)。
• 轻松添加对更多代理类型的支持(只需扩展FTPClientProxy)。
• 轻松地添加不支持的目录列表解析器(见CustomParser例子)。
• 使用TraceListeners进行事务记录(自动省略密码)。
• 几乎所有方法的例子(见例子)
• 不支持SFTP,因为它是通过SSH的FTP,一个完全不同的协议(使用SSH.NET)。

这些文档是我拿翻译软件翻译的,可能有些地方翻译的不准确
 


File Permissions 文件权限

Standard commands supported by most servers
大多数服务器支持的标准命令

GetChmod()

Gets the CHMOD permissions of the file/folder, or 0 if not found.
获取文件/文件夹的CHMOD权限,如果找不到,则为0。

GetFilePermissions()

Gets the permissions of the given file/folder as an FtpListItem object with all "Permission" properties set, or null if not found.
获取给定文件/文件夹的权限,作为FtpListItem对象,设置所有“Permission”属性,如果没有找到则为空。


Only supported by UNIX FTP servers which have the CHMOD extension installed and enabled.
仅支持安装并启用CHMOD扩展的UNIX FTP服务器。

Chmod()

Modifies the permissions of the given file/folder, given the CHMOD value.
根据CHMOD值修改给定文件/文件夹的权限。

SetFilePermissions()

Modifies the permissions of the given file/folder, given seperate owner/group/other values (FtpPermission enum).
修改给定文件/文件夹的权限,给定单独的所有者/组/其他值(FtpPermission enum)。
    

File Hashing 文件哈希

Standard commands supported by most servers
大多数服务器支持的标准命令

HashAlgorithms

Get the hash types supported by the server, if any (represented by flags).
获取服务器支持的哈希类型(如果有的话)(用标记表示)。

GetHash()

Gets the hash of an object on the server using the currently selected hash algorithm. Supported algorithms are available in the HashAlgorithms property. You should confirm that it's not equal to FtpHashAlgorithm.NONE (which means the server does not support the HASH command).
使用当前选定的哈希算法获取服务器上对象的哈希。支持的算法在hashalgalgorithms属性中可用。您应该确认它不等于FtpHashAlgorithm。NONE(这意味着服务器不支持HASH命令)。

GetHashAlgorithm()

Query the server for the currently selected hash algorithm for the HASH command.
在服务器上查询当前为hash命令选择的哈希算法。

SetHashAlgorithm()

Selects a hash algorithm for the HASH command, and stores this selection on the server.
为hash命令选择哈希算法,并将此选择存储在服务器上。


Non-standard commands supported by certain servers only. Import FluentFTP.Extensions to use these.
仅某些服务器支持的非标准命令。进口FluentFTP。使用这些扩展。

GetChecksum()

Retrieves a checksum of the given file using a checksumming method that the server supports, if any. The algorithm used goes in this order : HASH, MD5, XMD5, XSHA1, XSHA256, XSHA512, XCRC.
使用服务器支持的校验和方法(如果有的话)检索给定文件的校验和。所使用的算法依次为:HASH、MD5、XMD5、XSHA1、XSHA256、XSHA512、XCRC。

GetMD5()

Retrieves the MD5 checksum of the given file, if the server supports it.
如果服务器支持,检索给定文件的MD5校验和。

GetXMD5()

Retrieves the MD5 checksum of the given file, if the server supports it.
如果服务器支持,检索给定文件的MD5校验和。

GetXSHA1()

Retrieves the SHA1 checksum of the given file, if the server supports it.
如果服务器支持,检索给定文件的SHA1校验和。

GetXSHA256()

Retrieves the SHA256 checksum of the given file, if the server supports it.
如果服务器支持,检索给定文件的SHA256校验和。

GetXSHA512()

Retrieves the SHA512 checksum of the given file, if the server supports it.
如果服务器支持,检索给定文件的SHA512校验和。

GetXCRC()

Retrieves the CRC32 checksum of the given file, if the server supports it.
如果服务器支持,检索给定文件的CRC32校验和。


FTPS 文件传输协议

EncryptionMode

Type of SSL to use, or none. Explicit is TLS, Implicit is SSL. Default: FtpEncryptionMode.None.
要使用的SSL类型,或无。显式是TLS,隐式是SSL。默认值:FtpEncryptionMode.None。

DataConnectionEncryption

Indicates if data channel transfers should be encrypted. Default: true.
指示数据通道传输是否应加密。默认值:真的。

SslProtocols 

Encryption protocols to use. Default: SslProtocols.Default.
要使用的加密协议。默认值:SslProtocols.Default。

ClientCertificates

X509 client certificates to be used in SSL authentication process.
用于SSL认证的X509客户端证书。

ValidateCertificate

Event is fired to validate SSL certificates. If this event is not handled and there are errors validating the certificate the connection will be aborted.
事件以验证SSL证书。如果未处理此事件,且验证证书时出现错误,则连接将中止。


Advanced Settings 高级设置

GetDataType()

Checks if the transfer data type is ASCII or binary.
检查传输数据类型是ASCII还是二进制。

SetDataType()

Sets the transfer data type to ASCII or binary. Internally called during file reads, writes and appends.
将传输数据类型设置为ASCII或二进制。在文件读取、写入和追加期间内部调用。

DataConnectionType

Active or Passive connection. Default: FtpDataConnectionType.AutoPassive (tries EPSV then PASV then gives up)
主动连接或被动连接。默认值:FtpDataConnectionType。AutoPassive(尝试EPSV,然后PASV,然后放弃)

UngracefullDisconnection

Disconnect from the server without sending QUIT. Default: false.
断开与服务器的连接,不发送QUIT。默认值:false。

Encoding

Text encoding (ASCII or UTF8) used when talking with the server. ASCII is default, but upon connection, we switch to UTF8 if supported by the server. Manually setting this value overrides automatic detection. Default: Auto.
与服务器交谈时使用的文本编码(ASCII或UTF8)。ASCII是默认的,但在连接时,如果服务器支持,我们会切换到UTF8。手动设置这个值可以覆盖自动检测。默认值: 自动。

InternetProtocolVersions

Whether to use IPV4 and/or IPV6 when making a connection. All addresses returned during name resolution are tried until a successful connection is made. Default: Any.
在建立连接时是否使用IPV4和/或IPV6。在名称解析过程中返回的所有地址都会被尝试,直到建立成功的连接。默认值: 任何。

ActivePorts

List of ports to try using for Active FTP connections, or null to automatically select a port. Default: null.
为活动FTP连接尝试使用的端口列表,或者用null来自动选择一个端口。默认:空。

SocketPollInterval

Time that must pass (in milliseconds) since the last socket activity before calling Poll() on the socket to test for connectivity. Setting this interval too low will have a negative impact on perfomance. Setting this interval to 0 disables Poll()'ing all together. Default: 15000 (15 seconds).
在调用套接字上的Poll()来测试连接性之前,从最后一次套接字活动开始必须经过的时间(以毫秒计)。将这个时间间隔设置得太低会对性能产生负面影响。把这个时间间隔设置为0可以完全禁止Poll()的使用。默认值:15000(15秒)。

ConnectTimeout

Time to wait (in milliseconds) for a connection attempt to succeed, before giving up. Default: 15000 (15 seconds).
在放弃之前,等待连接尝试成功的时间(以毫秒计)。默认:15000(15秒)。

ReadTimeout

Time to wait (in milliseconds) for data to be read from the underlying stream, before giving up. Default: 15000 (15 seconds).
在放弃之前,等待从底层流中读取数据的时间(以毫秒计)。默认:15000(15秒)。

DataConnectionConnectTimeout

Time to wait (in milliseconds) for a data connection to be established, before giving up. Default: 15000 (15 seconds).
在放弃之前,等待数据连接建立的时间(以毫秒计)。默认:15000(15秒)。

DataConnectionReadTimeout

Time to wait (in milliseconds) for the server to send data on the data channel, before giving up. Default: 15000 (15 seconds).
在放弃之前,等待服务器在数据通道上发送数据的时间(以毫秒计)。默认:15000(15秒)。

SocketKeepAlive

Set SocketOption.KeepAlive on all future stream sockets. Default: false.
在所有未来的流套接字上设置SocketOption.KeepAlive。默认值:false。

StaleDataCheck

Check if there is stale (unrequested data) sitting on the socket or not. In some cases the control connection may time out but before the server closes the connection it might send a 4xx response that was unexpected and can cause synchronization errors with transactions. To avoid this problem the Execute() method checks to see if there is any data available on the socket before executing a command. Default: true.
检查套接字上是否有陈旧(未请求的数据)。在某些情况下,控制连接可能会超时,但在服务器关闭连接之前,它可能会发送一个4xx响应,这是意料之外的,会导致与事务的同步错误。为了避免这个问题,Execute()方法在执行命令前会检查套接字上是否有任何数据可用。默认值:true。

TransferChunkSize

Chunk size (in bytes) used during upload/download of files. Default: 65536 (65 KB).
上传/下载文件时使用的分块大小(以字节为单位)。默认:65536(65 KB)。

MaximumDereferenceCount

The maximum depth of recursion that DereferenceLink() will follow symbolic links before giving up. Default: 20.
DereferenceLink()在放弃之前跟踪符号链接的最大递归深度。默认值:20。

EnableThreadSafeDataConnections

Creates a new FTP connection for every file download and upload. This is slower but is a thread safe approach to make asynchronous operations on a single control connection transparent. Set this to false if your FTP server allows only one connection per username. Default: false.
为每个文件的下载和上传创建一个新的FTP连接。这比较慢,但这是一个线程安全的方法,使单个控制连接上的异步操作透明。如果你的FTP服务器只允许每个用户名有一个连接,请将此设置为false。默认:false。

IsClone

Checks if this control connection is a clone. Default: false.
检查此控制连接是否是克隆的。默认值:false。

结束

如果这个帖子对你有所帮助,欢迎 关注 + 点赞 + 留言

end

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

熊思宇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值