title: Writing to File in C# with/without relative paths
body: <p>I am currently trying to get user input from commandline <code>OutputPath</code></p>
  
  <pre><code> using (outfile = new StreamWriter(OutputPath))
   {
       outfile.Write(result);
   }
  </code></pre>
  
  <p>This writes to absolute path if given or writes the file under c:\windows\system32</p>
  
  <p>How can I make it either absolute path or depending on the current directory. Is there a way to get the current working directory from command line or is there a better API that can figure it out.</p>
  
  <p>Thanks</p>