title: Sharing variable using MemoryMappedFile gives error
body: <p>I need to share a variable value from App "A" to different applications on same system. I need to use only MemoryMappedFiles as per requirement. I created another simple App "B" which reads value of shared variable from App A.
  But App "B" gives error</p>
  
  <blockquote>
    <p>Unable to find the specified file.</p>
  </blockquote>
  
  <p>Sample App A and B written in C# using VS 2012 :</p>
  
  <p><strong>On Button click event of app A to share variable Name :</strong></p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      string Name = txtName.Text.ToString();
      int howManyBytes = Name.Length * sizeof(Char) + 4;
      label1.Text = howManyBytes.ToString();
  
      using (var MyText = MemoryMappedFile.CreateOrOpen("MyGlobalData", howManyBytes, MemoryMappedFileAccess.ReadWrite))
      {
          byte[] array1 = new byte[howManyBytes];
          array1 = GetBytes(Name);
  
          using (var accessor = MyText.CreateViewAccessor(0, array1.Length))
          {
              accessor.WriteArray(0, array1, 0, array1.Length);
          }
      }
  
  }
  
  static byte[] GetBytes(string str)
  {
      byte[] bytes = new byte[str.Length * sizeof(char)];
      System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
      return bytes;
  }
  </code></pre>
  
  <p><strong>On Button click event of app B to read shared variable MyGlobalData :</strong></p>
  
  <pre><code>try
  {
      using (var mmf = MemoryMappedFile.OpenExisting("MyGlobalData"))
      {
          using (var accessor = mmf.CreateViewAccessor(0, 34))
          {
              byte[] array1 = new byte[34];
              accessor.ReadArray(0, array1, 0, array1.Length);
  
              string result = System.Text.Encoding.UTF8.GetString(array1);
              txtName.Text = result;
          }
      }
  }
  catch (Exception ex)
  {
      MessageBox.Show(" Error :- " + ex.Message.ToString());
  }
  </code></pre>
  
  <p>When trying to read the shared variable from App B it gives error</p>
  
  <blockquote>
    <p>Unable to find the specified file</p>
  </blockquote>
  
  <p>Do i need to write variable value in txt file and then share it ?</p>