Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Portable FTP server written in .NET

License

NotificationsYou must be signed in to change notification settings

FubarDevelopment/FtpServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

This FTP server is written as .NET Standard 2.0 library and has anabstract file system which allows e.g. Google Drive as backend.

License

The library is released under theMIT license.

Support the development

Patreon

Prerequisites

Compilation

  • Visual Studio 2022 / C# 8.0

Using

  • Visual Studio 2022
  • .NET Standard 2.0 (everythingexcept sample application, PAM authentication)
  • .NET Core 3.1 (PAM authentication)

NuGet packages

Package nameDescriptionBadge
FubarDev.FtpServerCore libraryFubarDev.FtpServer
FubarDev.FtpServer.AbstractionsBasic typesFubarDev.FtpServer.Abstractions
FubarDev.FtpServer.FileSystem.DotNetSystem.IO-based file systemFubarDev.FtpServer.FileSystem.DotNet
FubarDev.FtpServer.FileSystem.GoogleDriveGoogle Drive as file systemFubarDev.FtpServer.FileSystem.GoogleDrive
FubarDev.FtpServer.FileSystem.InMemoryIn-memory file systemFubarDev.FtpServer.FileSystem.InMemory
FubarDev.FtpServer.FileSystem.UnixUnix file systemFubarDev.FtpServer.FileSystem.Unix
FubarDev.FtpServer.MembershipProvider.PamPAM membership providerFubarDev.FtpServer.MembershipProvider.Pam

Example FTP server

Creating the project

dotnet new consoledotnet add package FubarDev.FtpServer.FileSystem.DotNetdotnet add package FubarDev.FtpServerdotnet add package Microsoft.Extensions.DependencyInjection

Contents ofMain in Program.cs

// Setup dependency injectionvarservices=newServiceCollection();// use %TEMP%/TestFtpServer as root folderservices.Configure<DotNetFileSystemOptions>(opt=>opt.RootPath=Path.Combine(Path.GetTempPath(),"TestFtpServer"));// Add FTP server services// DotNetFileSystemProvider = Use the .NET file system functionality// AnonymousMembershipProvider = allow only anonymous loginsservices.AddFtpServer(builder=>builder.UseDotNetFileSystem()// Use the .NET file system functionality.EnableAnonymousAuthentication());// allow anonymous logins// Configure the FTP serverservices.Configure<FtpServerOptions>(opt=>opt.ServerAddress="127.0.0.1");// Build the service providerusing(varserviceProvider=services.BuildServiceProvider()){// Initialize the FTP servervarftpServerHost=serviceProvider.GetRequiredService<IFtpServerHost>();// Start the FTP serverftpServerHost.StartAsync(CancellationToken.None).Wait();Console.WriteLine("Press ENTER/RETURN to close the test application.");Console.ReadLine();// Stop the FTP serverftpServerHost.StopAsync(CancellationToken.None).Wait();}

[8]ページ先頭

©2009-2025 Movatter.jp