The first bug I can see is: last parameter of your
MemoryMappedFile.CreateOrOpen
call is supposed to be
System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Read
and
System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write
:
https://msdn.microsoft.com/en-us/library/dd267576%28v=vs.110%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.io.memorymappedfiles.memorymappedfileaccess%28v=vs.110%29.aspx[
^].
The namespace part of the type name, "
System.IO.MemoryMappedFiles.MemoryMappedFileAccess
" can be moved to "
using
".
Look, the problem is way too trivial; it's just about understanding C# very basic syntax and semantic and the ability to use the FCL documentation in a straightforward way. There is no such thing as "MemoryMappedFile syntax", it's about very basic language syntax and understanding of such basic things as type names and namespaces. I'm not sure you can advanced I/O programming without learning the language and platform properly; I personally would not even try before I learn the language.
—SA