I am following this tutorial here
I am having a hard time figuring out how to get a string \"THIS IS A TEST MESSAGE\" to store in the memory mapped file and then pull it
It Works fine with CreateOrOpen instead of CreateNew! With the same code
MemoryMappedFile mmf = MemoryMappedFile.CreateOrOpen("test", 1000);
MemoryMappedViewAccessor accessor = mmf.CreateViewAccessor();
accessor.Write(54, (ushort)Buffer.Length);
accessor.WriteArray(54 + 2, Buffer, 0, Buffer.Length);
and
MemoryMappedFile mmf = MemoryMappedFile.CreateOrOpen("test", 1000);
MemoryMappedViewAccessor accessor = mmf.CreateViewAccessor();
ushort Size = accessor.ReadUInt16(54);
byte[] Buffer = new byte[Size];
accessor.ReadArray(54 + 2, Buffer, 0, Buffer.Length);
MessageBox.Show(ASCIIEncoding.ASCII.GetString(Buffer));