title: Saved files contain (back)slashes
body: <p>I am trying to save some data to a file, but the files are saved to an incorrect directory.</p>
  
  <pre><code>using (StreamWriter sw = new StreamWriter(dir + "\\temp" + x + ".txt"))
      sw.Write(data);
  </code></pre>
  
  <p>On Windows, this works fine. However, when I run this on Linux (Ubuntu, but I don't think that matters), under Mono, my files get saved with the backslashes in the name.</p>
  
  <p>I have tried using <code>Path.Combine(dir, "temp" + x + ".txt");</code> and forward slashes. Didn't work.</p>
  
  <p>Anyone has any suggestions?</p>
  
  <p>EDIT: Turns out that my "trying" of the above mentioned solutions was not very good. I was so used to Visual Studio recompiling every time I ran the application that I forgot to check whether MonoDevelop actually did the same.</p>
  
  <p>After making changes and rebuilding I have found that all three solutions provided in the answers work.</p>