A simplified, protocol-agnostic .NET Standard 2.0 wrapper for remote file share operations. Currently supports SMB via SMBLibrary by Tal Aloni.
SMBLibrary is a powerful, pure .NET SMB client/server implementation supporting SMB 1.0 through 3.1.1. However, its low-level API requires significant boilerplate for common operations. SimpleShareLibrary provides an easy-to-use API for everyday file operations on remote shares.
Before (SMBLibrary):
SMB2Client client = new SMB2Client(); bool isConnected = client.Connect(IPAddress.Parse("192.168.1.11"), SMBTransportType.DirectTCPTransport); if (isConnected) { NTStatus status = client.Login(String.Empty, "user", "pass"); if (status == NTStatus.STATUS_SUCCESS) { ISMBFileStore fileStore = client.TreeConnect("Share", out status); if (status == NTStatus.STATUS_SUCCESS) { object fileHandle; FileStatus fileStatus; status = fileStore.CreateFile(out fileHandle, out fileStatus, "file.txt", AccessMask.GENERIC_READ | AccessMask.SYNCHRONIZE, FileAttributes.Normal, ShareAccess.Read, CreateDisposition.FILE_OPEN, CreateOptions.FILE_NON_DIRECTORY_FILE | CreateOptions.FILE_SYNCHRONOUS_IO_ALERT, null); // ... read loop, close, disconnect, logoff ... } } }After (SimpleShareLibrary):
using (var smb = new SmbClient("192.168.1.11", "Share", "user", "pass")) { byte[] data = smb.ReadFile("file.txt"); }See the docs/ directory for detailed documentation:
- Getting Started — installation, first connection, basic usage
- API Reference — full interface and options documentation
- Architecture — how the library is structured, provider model
- Contributing — how to contribute, adding new protocol providers
dotnet add package SimpleShareLibrary Contributions are welcome! The library is designed with a protocol-agnostic provider model — IShareClientFactory, IShareClient, and IShare are generic interfaces that any file sharing protocol can implement. Currently only SMB is supported, but adding providers for other protocols (NFS, SFTP, WebDAV, etc.) is straightforward.
See docs/contributing.md for details on how to get started.
This project is licensed under the MIT License.
This library uses SMBLibrary by Tal Aloni (@TalAloni) as a runtime NuGet dependency, licensed under LGPL-3.0-or-later. SMBLibrary is not embedded or merged into this assembly — it remains a separate, replaceable component as required by the LGPL.
All core SMB protocol implementation credit belongs to Tal Aloni and the SMBLibrary contributors.
This project is not affiliated with, endorsed by, or sponsored by Tal Aloni or the SMBLibrary project.
This software is provided "as is", without warranty of any kind. See DISCLAIMER.md for full details (English and German).
Built on top of SMBLibrary — a powerful, pure .NET SMB client/server implementation. Without SMBLibrary, this project would not exist.