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
<PackageReference Include="dmuka3.CS.Simple.RemoteIO" Version="1.0.0" />
paket add dmuka3.CS.Simple.RemoteIO --version 1.0.0
#r "nuget: dmuka3.CS.Simple.RemoteIO, 1.0.0"
// 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 | Versions 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. |
-
.NETCoreApp 3.0
- dmuka3.CS.Simple.Semaphore (>= 1.0.1)
- dmuka3.CS.Simple.TCP (>= 1.0.5)
- Newtonsoft.Json (>= 12.0.2)
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 | 500 | 10/29/2019 |