13 lines
340 B
C#
13 lines
340 B
C#
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.");
|
|
} |