NET's best open source FTP client library

NET's best open source FTP client library

FluentFTP is an FTP and FTPS client for. NET and. NET Standard.

最后更新 7/17/2023 7:59 PM
工具箱
预计阅读 2 分钟
分类
.NET
标签
.NET C# open source

FluentFTP is an FTP and FTPS client for. NET and. NET Standard.

It is optimized for speed, has no external dependence, and is written entirely in C#.

functional properties

Fully supports FTP, FXP, FTPS, FTPS with TLS 1.3, FTPS with client certificates, and FTPS proxy.

Fully supports more than 30 FTP Server types.

Supports various file and directory lists (Unix, Windows/IIS, Azure, Pure-FTPd, ProFTPD, Vax, VMS, OpenVMS, Tandem, HP NonStop Guardian, IBM z/OS and OS/400, Windows CE, Serv-U, etc.).

Supports recursive directory listing and directory deletion.

Progress tracking makes it easy to upload and download files from the server.

Create, append, read, write, rename, move, and delete files and folders.

Asynchronous support, all operations can use async await.

C#usage examples

// 通过用户名密码创建连接
var client = new AsyncFtpClient("123.123.123.123", "david", "pass123");

// 连接到服务器,并设置自动重连
await client.AutoConnect();

// 列出所有的文件
foreach (FtpListItem item in await client.GetListing("/htdocs")) {

    // 如果是文件类型
    if (item.Type == FtpObjectType.File) {

        // 获取文件大小
        long size = await client.GetFileSize(item.FullName);

        // 计算文件 hash
        FtpHash hash = await client.GetChecksum(item.FullName);
    }

    // 获取文件或文件夹的修改时间
    DateTime time = await client.GetModifiedTime(item.FullName);
}

// 上传一个文件
await client.UploadFile(@"C:\MyVideo.mp4", "/htdocs/MyVideo.mp4");

// 移动文件
await client.MoveFile("/htdocs/MyVideo.mp4", "/htdocs/MyVideo_2.mp4");

// 下载文件
await client.DownloadFile(@"C:\MyVideo_2.mp4", "/htdocs/MyVideo_2.mp4");

// 删除文件
await client.DeleteFile("/htdocs/MyVideo_2.mp4");

// 关闭连接,结束
await client.Disconnect();

project address

https://github.com/robinrodricks/FluentFTP

Keep Exploring

延伸阅读

更多文章
同分类 / 同标签 4/22/2026

Support for. NET by operating system versions (250707 update)

Use virtual machines and test machines to test the support of each version of the operating system for. NET. After installing the operating system, it is passed by measuring the corresponding running time of the installation and being able to run the Stardust Agent.

继续阅读
同分类 / 同标签 2/7/2026

Summary of experience in using AOT

From the very beginning of project creation, you should develop a good habit of conducting AOT release testing in a timely manner whenever new features are added or newer syntax is used.

继续阅读