Initial commit

This commit is contained in:
Matthias Heil
2026-11-18 11:20:47 +01:00
commit b08fbe13ee
6 changed files with 58 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################
/.vs
+13
View File
@@ -0,0 +1,13 @@
using SharedMemory;
try
{
using var numbers = new SharedArray<int>("MySharedArray");
Console.WriteLine(numbers.Length);
Console.WriteLine(numbers[0]);
Console.WriteLine(numbers[^1]);
}
catch (FileNotFoundException)
{
Console.WriteLine("No process has MySharedArray open. Start the first program before this one.");
}
+14
View File
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SharedMemory" Version="2.3.4" />
</ItemGroup>
</Project>
+4
View File
@@ -0,0 +1,4 @@
<Solution>
<Project Path="ReaderApp/ReaderApp.csproj" />
<Project Path="WriterApp/WriterApp.csproj" />
</Solution>
+8
View File
@@ -0,0 +1,8 @@
using SharedMemory;
using var numbers = new SharedArray<int>("MySharedArray", length: 10);
numbers[0] = 123;
numbers[^1] = 456;
Console.WriteLine("Start the second program, then press Enter here to close the array");
Console.ReadLine();
+14
View File
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SharedMemory" Version="2.3.4" />
</ItemGroup>
</Project>