title: Create a file in the userfiles folder (C#, Windows Forms)
body: <p>I'm trying to create a text file in my <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> application. It is working fine, but it is creating the text file in the application's default location (like in folder <code>bin</code>). But I want to save that created text file in my user files folder. How can I do it?</p>
  
  <p>This is my code:</p>
  
  <pre><code>FileInfo fileusername = new FileInfo("userinfo.txt");
  StreamWriter namewriter = fileusername.CreateText();
  namewriter.Write(txtUsername.Text);
  namewriter.Close();
  </code></pre>