![]() |
VOOZH | about |
dotnet add package SharpCifs.Std --version 0.2.13
NuGet\Install-Package SharpCifs.Std -Version 0.2.13
<PackageReference Include="SharpCifs.Std" Version="0.2.13" />
<PackageVersion Include="SharpCifs.Std" Version="0.2.13" />Directory.Packages.props
<PackageReference Include="SharpCifs.Std" />Project file
paket add SharpCifs.Std --version 0.2.13
#r "nuget: SharpCifs.Std, 0.2.13"
#:package SharpCifs.Std@0.2.13
#addin nuget:?package=SharpCifs.Std&version=0.2.13Install as a Cake Addin
#tool nuget:?package=SharpCifs.Std&version=0.2.13Install as a Cake Tool
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:
http://sharpcifsstd.dobes.jp/
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
//using System;
//using SharpCifs.Smb;
//Get SmbFile-Object of a folder.
var folder = new SmbFile("smb://UserName:Password@ServerIP/ShareName/FolderName/");
//UnixTime
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())
.ToLocalTime();
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}";
Console.WriteLine(msg);
}
//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.
((Stream)readStream).CopyTo(memStream);
//Dispose readable stream.
readStream.Dispose();
Console.WriteLine(Encoding.UTF8.GetString(memStream.ToArray()));
//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.
file.CreateNewFile();
//Get writable stream.
var writeStream = file.GetOutputStream();
//Write bytes.
writeStream.Write(Encoding.UTF8.GetBytes("Hello!"));
//Dispose writable stream.
writeStream.Dispose();
//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()}");
try
{
//Get servers in workgroup.
var servers = workgroup.ListFiles();
foreach (var server in servers)
{
Console.WriteLine($"{workgroup.GetName()} - Server Name = {server.GetName()}");
try
{
//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: http://sharpcifsstd.dobes.jp/#howtouse
ComicLAN (Xamarin.iOS implements - App Store link)
Project Site:
http://sharpcifsstd.dobes.jp/
GitHub - zinkpad/SharpCifs: SharpCifs is a port of JCIFS to C#
https://github.com/zinkpad/SharpCifs
JCIFS - The Java CIFS Client Library
https://jcifs.samba.org/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 netcoreapp1.0 was computed. netcoreapp1.1 netcoreapp1.1 was computed. netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.3 netstandard1.3 is compatible. netstandard1.4 netstandard1.4 was computed. netstandard1.5 netstandard1.5 was computed. netstandard1.6 netstandard1.6 was computed. netstandard2.0 netstandard2.0 was computed. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen30 tizen30 was computed. tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Universal Windows Platform | uap uap was computed. uap10.0 uap10.0 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on SharpCifs.Std:
| Package | Downloads |
|---|---|
|
Apalla.Bubu.Shared
Bubu is application framework to easily build crossplatform applications. Apalla.Bubu.Shared contains general classes for all application types and platforms. |
|
|
IG.Data.SqlClient
Patch over Microsoft.Data.SqlClient to get NTLM support on linux |
|
|
Xb.Net.SmbTree
Ready to Xamarin & .NET Core, SMB Shared Folder Access Library. based on Xb.File.Tree. SMB depend on SharpCifs.Std. |
|
|
PlatformBindings-SMB
SMB/CIFS File/Folder Container Extension for the .NET Platform Bindings Framework |
|
|
Reveal.Sdk.Data.Microsoft.AnalysisServices
Reveal SDK Analysis Services and Azure Analysis Services data source |
Showing the top 1 popular GitHub repositories that depend on SharpCifs.Std:
| Repository | Stars |
|---|---|
|
thecodrr/BreadPlayer
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 | 11,221,865 | 4/11/2019 |
| 0.2.12 | 404,406 | 2/4/2018 |
| 0.2.11 | 184,269 | 9/30/2017 |
| 0.2.10 | 179,294 | 9/22/2017 |
| 0.2.9 | 179,663 | 7/2/2017 |
| 0.2.8 | 179,270 | 6/20/2017 |
| 0.2.7 | 179,286 | 6/20/2017 |
| 0.2.6 | 179,284 | 6/5/2017 |
| 0.2.5 | 187,459 | 5/12/2017 |
| 0.2.4 | 179,534 | 5/10/2017 |
| 0.2.3 | 180,510 | 5/9/2017 |
| 0.2.2 | 179,172 | 5/8/2017 |
| 0.2.0 | 179,678 | 5/4/2017 |
| 0.1.8-beta1 | 2,301 | 4/10/2017 |
| 0.1.6-beta1 | 2,891 | 3/1/2017 |
| 0.1.5-beta1 | 2,857 | 12/31/2016 |
| 0.1.3-beta1 | 3,907 | 12/27/2016 |
| 0.1.0-beta1 | 3,026 | 12/27/2016 |
fix WrappedSystemStream.Dipose, update HexDump. Thanks mukmyash and anat0li!