SambaUtils 0.2.1
dotnet add package SambaUtils --version 0.2.1
NuGet\Install-Package SambaUtils -Version 0.2.1
<PackageReference Include="SambaUtils" Version="0.2.1" />
<PackageVersion Include="SambaUtils" Version="0.2.1" />
<PackageReference Include="SambaUtils" />
paket add SambaUtils --version 0.2.1
#r "nuget: SambaUtils, 0.2.1"
#:package SambaUtils@0.2.1
#addin nuget:?package=SambaUtils&version=0.2.1
#tool nuget:?package=SambaUtils&version=0.2.1
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
MSBuildfrom 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 | net5.0 is compatible. net5.0-windows was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- No dependencies.
-
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.