title: When working with paths to server files, when is it necessary to use back or forward slashes (single or double)?
body: <p>Regarding the following code sample:</p>
  
  <pre><code>string baseLocation = HttpContext.Current.Server.MapPath("/");
  const string templateName = @"//temp//ExportTemplate.xlsx";
  const string generatedLocation = @"{0}//temp//{1}";
  var fileName = string.Format("Export-{0}.xlsx", DateTime.Now.Date.ToString("yyyy-MM-dd"));
  var newFile = String.Format(generatedLocation, baseLocation, fileName);
  File.Copy(baseLocation + templateName, newFile, true);
  </code></pre>
  
  <p>We are using this on a production server and a local dev environment (via a site in IIS). Both are running IIS 7.5. The code works correctly on production, but throws an error in local dev:</p>
  
  <pre><code>Access to the path 'C:\Path\To\Site\//temp//Export-2013-01-29.xlsx' is denied.
  </code></pre>
  
  <p>The file is created/copied correctly on local dev, but I'm guessing it's erroring out due to the slashes in the path being incorrect. The app pool identity has full access to the 'temp' folder.</p>
  
  <p>This brings up a couple questions:</p>
  
  <ul>
  <li>In this situation, what does the '//' do to path? I understand '\' is the way to escape a backslash, but the '//' doesn't make sense.</li>
  <li>Could there be a difference in the configuration of the two environments that makes the generated path work correctly on the production server but fail in my local dev?</li>
  </ul>