SharpCifs.Std 0.2.13

.NET Standard 1.3
dotnet add package SharpCifs.Std --version 0.2.13
NuGet\Install-Package SharpCifs.Std -Version 0.2.13
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpCifs.Std" Version="0.2.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpCifs.Std --version 0.2.13
#r "nuget: SharpCifs.Std, 0.2.13"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SharpCifs.Std as a Cake Addin
#addin nuget:?package=SharpCifs.Std&version=0.2.13

// Install SharpCifs.Std as a Cake Tool
#tool nuget:?package=SharpCifs.Std&version=0.2.13



This library has only SMB version 1 features, which are not supported by the current Windows.
See: TalAloni's SMBLibrary implements SMB Client and Server, or my Simple Client Wrapper EzSmb.

Xamarin & .NET Core Ready, SMB/CIFS(Windows shared folder) Access Library.
This is a port of SharpCifs to .NET Standard.

Project Site:

Xamarin/.NET Core対応のSMB/CIFS(Windows共有)アクセスライブラリです。
SharpCifsを .NET Standard に移植したものです。


You can access the Windows shared folder, NAS by Xamarin, .NET Core.(= without mpr.dll, Netapi32.dll)
It's a rework of SharpCifs, and The origin is JCIFS.

Windowsの共有フォルダやNASへ、Xamarin/.NET Coreアプリからアクセス出来ます。
JCIFSのWindows Phone 8.1移植版だったSharpCifsを、.NET Standardで動作するように修正しました。

Supports .NET Standard 1.3 (= Xamarin.Android/iOS1.0, .NET Core1.0, .NET Framework 4.6)


System.Console (>= 4.3.0)
System.Net.NameResolution (>= 4.3.0)
System.Net.NetworkInformation (>= 4.3.0)
System.Net.Sockets (>= 4.3.0)
System.Security.Cryptography.Algorithms (>= 4.3.0)
System.Security.Cryptography.Primitives (>= 4.3.0)
System.Threading.Tasks (>=4.3.0)
~System.Threading.Thread (>= 4.3.0)~ ←removed


  1. Add NuGet Package to your project, or download this and add ref SharpCifs.STD1.3/SharpCifs.STD1.3.csproj
  2. setting, ussage are same as JCIFS.


  1. プロジェクトにNuGetパッケージを追加するか、
     もしくはこのソースをダウンロードの上 SharpCifs.STD1.3/SharpCifs.STD1.3.csproj をプロジェクト参照してください。
  2. 設定や使い方は、JCIFSに準じます。


Get items in shared folder:

//using System;
//using SharpCifs.Smb;

//Get SmbFile-Object of a folder.
var folder = new SmbFile("smb://UserName:Password@ServerIP/ShareName/FolderName/");

var epocDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

//List items
foreach (SmbFile item in folder.ListFiles())
    var lastModDate = epocDate.AddMilliseconds(item.LastModified())

    var name = item.GetName();
    var type = item.IsDirectory() ? "dir" : "file";
    var date = lastModDate.ToString("yyyy-MM-dd HH:mm:ss");
    var msg = $"{name} ({type}) - LastMod: {date}";


Read a File:

//using System;
//using System.IO;
//using System.Text;
//using SharpCifs.Smb;

//Get target's SmbFile.
var file = new SmbFile("smb://UserName:Password@ServerIP/ShareName/Folder/FileName.txt");

//Get readable stream.
var readStream = file.GetInputStream();

//Create reading buffer.
var memStream = new MemoryStream();

//Get bytes.

//Dispose readable stream.



Create a new File:

//using System.Text;
//using SharpCifs.Smb;

//Get the SmbFile specifying the file name to be created.
var file = new SmbFile("smb://UserName:Password@ServerIP/ShareName/Folder/NewFileName.txt");

//Create file.

//Get writable stream.
var writeStream = file.GetOutputStream();

//Write bytes.

//Dispose writable stream.


Scan Servers & Shares on LAN:

//using System;
//using SharpCifs.Smb;

//When using the host name when connecting,
//When using the host name when connecting,
//Change default local port(137) to a value larger than 1024.
//In many cases, use of the well-known port is restricted.
// ** If possible, using IP addresses instead of host names 
// ** to get better performance.
SharpCifs.Config.SetProperty("jcifs.smb.client.lport", "8137");

//Get local workgroups.
var lan = new SmbFile("smb://", "");
var workgroups = lan.ListFiles();

foreach (var workgroup in workgroups)
    Console.WriteLine($"Workgroup Name = {workgroup.GetName()}");

        //Get servers in workgroup.
        var servers = workgroup.ListFiles();
        foreach (var server in servers)
            Console.WriteLine($"{workgroup.GetName()} - Server Name = {server.GetName()}");

                //Get shared folders in server.
                var shares = server.ListFiles();

                foreach (var share in shares)
                    Console.WriteLine($"{workgroup.GetName()}{server.GetName()} - Share Name = {share.GetName()}");
            catch (Exception)
                Console.WriteLine($"{workgroup.GetName()}{server.GetName()} - Access Denied");
    catch (Exception)
        Console.WriteLine($"{workgroup.GetName()} - Access Denied");

More samples:


LGPL v2.1 Licence


ComicLAN (Xamarin.iOS implements - App Store link)



Project Site:

GitHub - zinkpad/SharpCifs: SharpCifs is a port of JCIFS to C#

JCIFS - The Java CIFS Client Library

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on SharpCifs.Std:

Package Downloads

Bubu is application framework to easily build crossplatform applications. Apalla.Bubu.Shared contains general classes for all application types and platforms.


Ready to Xamarin & .NET Core, SMB Shared Folder Access Library. based on Xb.File.Tree. SMB depend on SharpCifs.Std.


Patch over Microsoft.Data.SqlClient to get NTLM support on linux


SMB/CIFS File/Folder Container Extension for the .NET Platform Bindings Framework


Extension to be used in HealthCheckUI of Xabaril/AspNetCore.Diagnostics.HealthChecks More information on the parent project at: <a href=""> Xabaril/AspNetCore.Diagnostics.HealthChecks</a>

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on SharpCifs.Std:

Repository Stars
Bread Player, a free and open source music player powered by UWP and C#/.NET with a sleek and polished design built for, and by, the people seeking a better alternative to Groove and Windows Media Player by Microsoft.
Version Downloads Last updated
0.2.13 3,586,412 4/11/2019
0.2.12 142,315 2/4/2018
0.2.11 5,606 9/30/2017
0.2.10 893 9/22/2017
0.2.9 1,209 7/2/2017
0.2.8 881 6/20/2017
0.2.7 857 6/20/2017
0.2.6 876 6/5/2017
0.2.5 2,165 5/12/2017
0.2.4 966 5/10/2017
0.2.3 1,003 5/9/2017
0.2.2 852 5/8/2017
0.2.0 1,020 5/4/2017
0.1.8-beta1 690 4/10/2017
0.1.6-beta1 1,031 3/1/2017
0.1.5-beta1 977 12/31/2016
0.1.3-beta1 1,431 12/27/2016
0.1.0-beta1 950 12/27/2016

fix WrappedSystemStream.Dipose, update HexDump. Thanks mukmyash and anat0li!