SambaUtils 0.2.0
See the version list below for details.
dotnet add package SambaUtils --version 0.2.0
NuGet\Install-Package SambaUtils -Version 0.2.0
<PackageReference Include="SambaUtils" Version="0.2.0" />
paket add SambaUtils --version 0.2.0
#r "nuget: SambaUtils, 0.2.0"
// Install SambaUtils as a Cake Addin #addin nuget:?package=SambaUtils&version=0.2.0 // Install SambaUtils as a Cake Tool #tool nuget:?package=SambaUtils&version=0.2.0
SambaUtils
A C# .NET Library to handle mounting/unmounting Samba shares on Windows.
Description
SambaUtils provides 2 methods (mount, unmount) to handle Samba shares on Windows, while reducing needed boilerplate code to handle net use
.
Samba stdout/err can be enabled with SambaUtils.Options.PrintOut = true
Getting Started
Dependencies
- Project targets .NET 6. SDK required for building.
- We don't call anything specific, so building for .NET 4.8 or .NET 5 isn't an issue.
Building
- Building the library from scratch just requires you to download the solution, then build this through your .NET IDE of choice
- You can also use
MSBuild
from the CLI to build the file.
Installing
Add reference to SambaUtils.dll in your .NET Project.
Alternatively, download the SambaUtils package from Nuget (.NET 6).
Usage
C# Example
public static void Main(string[] args)
{
Share samba = new Share
{
Unc = @"\\nas\storage", // UNC path for Samba Share
Mount = 'z', // requested mountpoint
Credentials = new KeyValuePair<string, string>("username", "password") //samba credentials, could be read from file or pulled from another (safer) source.
};
// Enable stdout/err output for `net use`
SambaUtils.Options.PrintOut = true;
Samba.Mount(samba); // mount the network share with the given parameters
Samba.Unmount(samba); // unmount the network share.
}
Authors
Version History
- 0.2
- .NET 6 port
- 0.1
- Initial Release
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.