dmuka3.CS.Simple.RemoteIO 1.0.0

dotnet add package dmuka3.CS.Simple.RemoteIO --version 1.0.0
NuGet\Install-Package dmuka3.CS.Simple.RemoteIO -Version 1.0.0
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="dmuka3.CS.Simple.RemoteIO" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add dmuka3.CS.Simple.RemoteIO --version 1.0.0
#r "nuget: dmuka3.CS.Simple.RemoteIO, 1.0.0"
#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 dmuka3.CS.Simple.RemoteIO as a Cake Addin
#addin nuget:?package=dmuka3.CS.Simple.RemoteIO&version=1.0.0

// Install dmuka3.CS.Simple.RemoteIO as a Cake Tool
#tool nuget:?package=dmuka3.CS.Simple.RemoteIO&version=1.0.0

dmuka3.CS.Simple.RemoteIO

This library provides you to connect to files and directories. Thus, you can manage your file system using network.

Nuget

Link : https://www.nuget.org/packages/dmuka3.CS.Simple.RemoteIO

Install-Package dmuka3.CS.Simple.RemoteIO

Example 1

We should create a server to connect to the file system. After that, we will try something on RemoteIO server.

// We are creating a server.
RemoteIOServer server = new RemoteIOServer("muhammed", "123123", 2048, 4, 9090, timeOutAuth: 1);
// Start server async.
new Thread(() =>
{
  server.Start();
}).Start();

// Wait the server
Thread.Sleep(1000);

// Create a client to connect to server.
RemoteIOClient client = new RemoteIOClient("127.0.0.1", 9090);
// Start communication.
client.Start("muhammed", "123123", 2048);

// Write a file with byte[].
client.WriteFile("my_nunit_text_file.txt", Encoding.UTF8.GetBytes("MUHAMMET KANDEMİR"));
// Read a file from server.
var v = Encoding.UTF8.GetString(client.ReadFile("my_nunit_text_file.txt"));
// Delete a file on server.
client.DeleteFile("my_nunit_text_file.txt");

// Delete a directory recursive on server.
client.DeleteDirectory("my_nunit_directory");
// Create a directory on server.
client.CreateDirectory("my_nunit_directory");
// Create a directory on server again.
client.CreateDirectory("my_nunit_directory\\sub");
// Checking file exists.
var exists1 = client.FileExists("my_nunit_directory\\sub\\test.txt");
// Write a file with byte[].
client.WriteFile("my_nunit_directory\\sub\\test.txt", Encoding.UTF8.GetBytes("MUHAMMET KANDEMİR"));
// Checking file exists.
var exists2 = client.FileExists("my_nunit_directory\\sub\\test.txt");
// Write a file with byte[].
client.WriteFile("my_nunit_directory\\test.txt", Encoding.UTF8.GetBytes("MUHAMMET KANDEMİR"));
// Get file list in a directory from server.
var files = client.GetFiles("my_nunit_directory", onlyCurrent: false);
// Delete a directory recursive.
client.DeleteDirectory("my_nunit_directory");

// Close client and server.
client.Dispose();
server.Dispose();

Assert.IsFalse(exists1);
Assert.IsTrue(exists2);
Assert.AreEqual(v, "MUHAMMET KANDEMİR");
Assert.AreEqual(files.Length, 2);
Assert.AreEqual(files[0], "test.txt");
Assert.AreEqual(files[1], "sub\\test.txt");  

You may wonder what is the "2048". It is key size of RSA. We always use RSA during communication on TCP. This is security to save your secret datas.

You have to know that you will never get an error while you are using some methods. For instance, DeleteDirectory doesn't throw and error if the directory doesn't exist. Just like DeleteFile. But don't forget, you can get an error about another reasons(File locked, path is wrong or something like that).

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 456 10/29/2019