title: Relative path to current directory in code-behind isn't consistent
body: <p>I have an asp.net website that writes some data to a TXT file using a relative path. It does so with this command: </p>
  
  <pre><code>string currentDirectory = "./";
  string individualDeviceTxt = "myfile.txt";    
  
  System.IO.StreamWriter fileW3 = new System.IO.StreamWriter(currentDirectory + individualDeviceTxt);
  </code></pre>
  
  <p>The file writes successfully to the following path:</p>
  
  <p>C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0</p>
  
  <p>however, later on, when I try to transmit this file to the user, the relative directory ./ is pointed at a different path. Here is the code:</p>
  
  <pre><code>System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
  response.Clear();
  response.AddHeader("Content-Disposition", "attachment; filename=" + currentDirectory + individualDeviceTxt + ";");
  response.TransmitFile(currentDirectory + individualDeviceTxt);
  response.End();
  </code></pre>
  
  <p>it is trying to send the file FROM 'C:\Users\user\documents\visual studio 2010\Projects\myproject\myfile.txt which is not correct (it doesn't exist there.)</p>
  
  <p>So it's apparent that "./" is pointed to a different folder for my second code snippet, but I want to be pointed to the same "./" used in the first snippet. What do I need to do to make this happen? I want to continue using ./ as the directory for myfile.txt in both spots.</p>