title: Convert Dictionary to string without using files
body: <p>I have a Dictionary and i want to serialize it to call a method. In this method i wiil recive a string and i need to deserialize it to use.
  I want the way to convert Dictionary to string and to convert string to Dictionary again.
  There is any way to do it without using files?</p>
  
  <p>Finally the code i've used is:</p>
  
  <pre><code>private string Serialize(Dictionary&lt;string, object&gt; parameters)
  {
      using (MemoryStream memoryStream = new MemoryStream()) {
          BinaryFormatter binaryFormatter = new BinaryFormatter();
          binaryFormatter.Serialize(memoryStream, parameters);
          return Convert.ToBase64String(memoryStream.ToArray());
      }
  }
  
  private Dictionary&lt;string, object&gt; Deserialize(string data)
  {
      using (MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(data))) {
          IFormatter formatter = new BinaryFormatter();
          memoryStream.Seek(0, SeekOrigin.Begin);
          return (Dictionary&lt;string, object&gt;)formatter.Deserialize(memoryStream);
      }
  }
  </code></pre>
  
  <p>Thanks!</p>