Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
################################################################################
|
||||||
|
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
/.vs
|
||||||
@@ -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.");
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<Solution>
|
||||||
|
<Project Path="ReaderApp/ReaderApp.csproj" />
|
||||||
|
<Project Path="WriterApp/WriterApp.csproj" />
|
||||||
|
</Solution>
|
||||||
@@ -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();
|
||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user