Once you know it you’ll probably never forget it…but wait, this is the second time I’ve googled for this. I’d best post how you “get the Windows temporary directory using C#“!

string tempPath =
    System.IO.Path.GetTempPath();

Related posts:

  1. Windows Azure – 503 Service Unavailable
  2. How to install Caplin Systems’ Liberator Free Edition on Windows
  3. Linkstation NAS Folder share with Windows Vista
  4. Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest
  5. Response.Redirect in Windows Azure
Tagged with:
 
  • Matthew Fritz

    Something so simple. I googled this and found my way here! Thanks Phil!

  • Erick Figueroa

    do you know how to replace the double backslash from the path string for single slash? I tried wuth .Replace method without succed… I need it for locate a file in my aplication

    • http://www.leggetter.co.uk Phil Leggetter

      Double backslash will escape to a single backslash.

      e.g. “c:\” will become “c:”

      To keep the double backslash you need to precede the string with an @ to stop the backlash being escaped.

      e.g. @”c:\”

      If you want to replace slashes in a string the following would work:

      string newValue = “c:\tempsomething”.Replace(@”");

      newValue should then have a value of “c:tempsomething”.

Set your Twitter account name in your settings to use the TwitterBar Section.